From b03428cd6b50352ad50ddf9b8873af2d2dc901b0 Mon Sep 17 00:00:00 2001 From: Ignacio Casal Quinteiro Date: Wed, 18 Mar 2020 16:51:12 +0100 Subject: [PATCH] Do not try to get the attachment if the node is NULL This fixes lots of warnings when trying to get the attachments --- prpl/attachments.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prpl/attachments.c b/prpl/attachments.c index 208e753..0621cbc 100644 --- a/prpl/attachments.c +++ b/prpl/attachments.c @@ -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); -- 2.51.0