about summary refs log tree commit diff stats
path: root/src/xmpp/stanza.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp/stanza.c')
-rw-r--r--src/xmpp/stanza.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c
index 46adb50e..bb7e9092 100644
--- a/src/xmpp/stanza.c
+++ b/src/xmpp/stanza.c
@@ -2484,9 +2484,11 @@ stanza_get_child_by_name_and_ns(xmpp_stanza_t * const stanza, const char * const
 {
     xmpp_stanza_t *child;
     const char *child_ns;
+    const char *child_name;
 
     for (child = xmpp_stanza_get_children(stanza); child; child = xmpp_stanza_get_next(child)) {
-        if (strcmp(name, xmpp_stanza_get_name(child)) == 0) {
+        child_name = xmpp_stanza_get_name(child);
+        if (child_name && strcmp(name, child_name) == 0) {
             child_ns = xmpp_stanza_get_ns(child);
             if (child_ns && strcmp(ns, child_ns) == 0) {
                 break;