commit 0ee61d5

default  ·  2023-08-25 05:47:18 +0000 UTC
parent 5518bb5
mastoapi: ensure attachment and tag lists are tags.
1 files changed,  +6, -0
+6, -0
 1@@ -709,7 +709,10 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
 2         attr_list = xs_list_append(attr_list, att);
 3     }
 4     else
 5+    if (xs_type(att) == XSTYPE_LIST)
 6         attr_list = xs_dup(att);
 7+    else
 8+        attr_list = xs_list_new();
 9 
10     /* if it has an image, add it as an attachment */
11     xs_dict *image = xs_dict_get(msg, "image");
12@@ -777,7 +780,10 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
13             tag_list = xs_list_append(tag_list, tag);
14         }
15         else
16+        if (xs_type(tag) == XSTYPE_LIST)
17             tag_list = xs_dup(tag);
18+        else
19+            tag_list = xs_list_new();
20 
21         tag = tag_list;
22         xs_dict *v;