1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Handle resource not found on sofware version request

This commit is contained in:
James Booth 2015-08-05 01:14:41 +01:00
parent 0b7c79ac13
commit af38ddc9e7

View File

@ -898,6 +898,10 @@ _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
} else { } else {
PContact contact = roster_get_contact(jidp->barejid); PContact contact = roster_get_contact(jidp->barejid);
Resource *resource = p_contact_get_resource(contact, jidp->resourcepart); 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); presence = string_from_resource_presence(resource->presence);
} }