]> www.infradead.org Git - pidgin-chime.git/commitdiff
Do not try to get the attachment if the node is NULL
authorIgnacio Casal Quinteiro <qignacio@amazon.com>
Wed, 18 Mar 2020 15:51:12 +0000 (16:51 +0100)
committerIgnacio Casal Quinteiro <qignacio@amazon.com>
Wed, 18 Mar 2020 15:51:12 +0000 (16:51 +0100)
This fixes lots of warnings when trying to get the attachments

prpl/attachments.c

index 208e75337ae97dddc07a509216c22d725b01ee28..0621cbc8d0cb0cd9af8deb2dfef30c589b1046dc 100644 (file)
@@ -159,7 +159,7 @@ ChimeAttachment *extract_attachment(JsonNode *record)
        robj = json_node_get_object(record);
        g_return_val_if_fail(robj != NULL, NULL);
        node = json_object_get_member(robj, "Attachment");
-       if (!node)
+       if (!node || json_node_is_null(node))
                return NULL;
 
        g_return_val_if_fail(parse_string(record, "MessageId", &msg_id), NULL);