about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-08-05 01:14:41 +0100
committerJames Booth <boothj5@gmail.com>2015-08-05 01:14:41 +0100
commitaf38ddc9e73024b0871696263c37dfb4954a03de (patch)
treeab2bf24c08269d0c219d31f261e9fabf460f714b /src/xmpp
parent0b7c79ac13b80b12c776437b8ad603a808583686 (diff)
downloadprofani-tty-af38ddc9e73024b0871696263c37dfb4954a03de.tar.gz
Handle resource not found on sofware version request
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/iq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index 58eded8c..a07fbf73 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -898,6 +898,10 @@ _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
     } else {
         PContact contact = roster_get_contact(jidp->barejid);
         Resource *resource = p_contact_get_resource(contact, jidp->resourcepart);
+        if (!resource) {
+            ui_handle_software_version_error(jidp->fulljid, "Unknown resource");
+            return 0;
+        }
         presence = string_from_resource_presence(resource->presence);
     }