fix input validation
This commit is contained in:
parent
620d4d5b8b
commit
ccc6dab512
1 changed files with 2 additions and 1 deletions
|
@ -304,8 +304,9 @@ void p2tgl_chat_update (PurpleChat *chat, tgl_peer_id_t id, int admin_id, const
|
|||
|
||||
tgl_chat_id_t p2tgl_chat_get_id (PurpleChat *PC) {
|
||||
char *name = g_hash_table_lookup (purple_chat_get_components (PC), "id");
|
||||
if (! atoi (name)) {
|
||||
if (! name || ! atoi (name)) {
|
||||
warning ("p2tgl_chat_id_get: no id found in chat %s", PC->alias);
|
||||
return TGL_MK_CHAT(0);
|
||||
}
|
||||
return TGL_MK_CHAT(atoi (name));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue