1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Check for NULL before clearing connection data

This commit is contained in:
James Booth 2016-06-01 22:41:17 +01:00
parent 784d9642bc
commit 086fd30e23

View File

@ -216,10 +216,14 @@ connection_set_disconnected(void)
void void
connection_clear_data(void) connection_clear_data(void)
{ {
g_hash_table_destroy(conn.features_by_jid); if (conn.features_by_jid) {
conn.features_by_jid = NULL; g_hash_table_destroy(conn.features_by_jid);
conn.features_by_jid = NULL;
}
g_hash_table_remove_all(conn.available_resources); if (conn.available_resources) {
g_hash_table_remove_all(conn.available_resources);
}
} }
#ifdef HAVE_LIBMESODE #ifdef HAVE_LIBMESODE