Ensure jbi->jb->resources is non-NULL before calling g_hash_table_size()

Tue, 27 May 2008 02:10:35 +0000

author
Evan Schoenberg <evands@pidgin.im>
date
Tue, 27 May 2008 02:10:35 +0000
changeset 23355
b2ea6d1a8eef
parent 23354
948de74a1a70
child 23356
27bfab55be5c

Ensure jbi->jb->resources is non-NULL before calling g_hash_table_size()

libpurple/protocols/jabber/buddy.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/jabber/buddy.c	Tue May 27 01:38:38 2008 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Tue May 27 02:10:35 2008 +0000
@@ -960,7 +960,7 @@
 		}
 #endif
 	} else {
-		gboolean multiple_resources = g_hash_table_size(jbi->jb->resources) > 1;
+		gboolean multiple_resources = jbi->jb->resources && (g_hash_table_size(jbi->jb->resources) > 1);
 
 		for(resources = jbi->jb->resources; resources; resources = resources->next) {
 			char *purdy = NULL;

mercurial