about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-07-03 23:44:51 +0100
committerJames Booth <boothj5@gmail.com>2013-07-03 23:44:51 +0100
commit581c1e8b951d7b9841cec56d5ebf9d3c138e6ce9 (patch)
tree45645cc4fa432bc48be631aa6782469abadc4269 /src/xmpp
parent817857e4c0d986226b7c213debca9de4f32e979a (diff)
downloadprofani-tty-581c1e8b951d7b9841cec56d5ebf9d3c138e6ce9.tar.gz
Coloured contact and subscription in /roster and /group output
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/roster.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/xmpp/roster.c b/src/xmpp/roster.c
index f96a3f84..ed72d502 100644
--- a/src/xmpp/roster.c
+++ b/src/xmpp/roster.c
@@ -562,14 +562,16 @@ _roster_handle_push(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
 
         // remove each fulljid
         PContact contact = roster_get_contact(barejid);
-        GList *resources = p_contact_get_available_resources(contact);
-        while (resources != NULL) {
-            GString *fulljid = g_string_new(strdup(barejid));
-            g_string_append(fulljid, "/");
-            g_string_append(fulljid, strdup(resources->data));
-            autocomplete_remove(fulljid_ac, fulljid->str);
-            g_string_free(fulljid, TRUE);
-            resources = g_list_next(resources);
+        if (contact != NULL) {
+            GList *resources = p_contact_get_available_resources(contact);
+            while (resources != NULL) {
+                GString *fulljid = g_string_new(strdup(barejid));
+                g_string_append(fulljid, "/");
+                g_string_append(fulljid, strdup(resources->data));
+                autocomplete_remove(fulljid_ac, fulljid->str);
+                g_string_free(fulljid, TRUE);
+                resources = g_list_next(resources);
+            }
         }
 
         // remove the contact