1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-02-02 15:08:15 -05:00

Added null check for presence error stanza namespace element

Issue #341
This commit is contained in:
James Booth 2014-05-05 22:01:27 +01:00
parent f247f367e9
commit ba8d1325ad

View File

@ -336,7 +336,10 @@ _presence_error_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM);
xmpp_stanza_t *error_stanza = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_ERROR);
xmpp_stanza_t *x = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_X);
char *xmlns = xmpp_stanza_get_ns(x);
char *xmlns = NULL;
if (x != NULL) {
xmlns = xmpp_stanza_get_ns(x);
}
char *type = NULL;
if (error_stanza != NULL) {
type = xmpp_stanza_get_attribute(error_stanza, STANZA_ATTR_TYPE);