summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2025-02-08 16:59:26 +0100
committerGravatar default2025-02-08 16:59:26 +0100
commit99d28c3d6c476a1d70b83a5685fbc53dcb74dc2f (patch)
tree83df35ed37c5c21f681fa3a0aeceaa057079e8e7
parentShow links to followed hashtags just below the list of lists. (diff)
downloadpenes-snac2-99d28c3d6c476a1d70b83a5685fbc53dcb74dc2f.tar.gz
penes-snac2-99d28c3d6c476a1d70b83a5685fbc53dcb74dc2f.tar.xz
penes-snac2-99d28c3d6c476a1d70b83a5685fbc53dcb74dc2f.zip
Fixed crash in incomplete poll post.
-rw-r--r--html.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/html.c b/html.c
index f39bef4..e742e94 100644
--- a/html.c
+++ b/html.c
@@ -2099,16 +2099,17 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
2099 const char *name = xs_dict_get(v, "name"); 2099 const char *name = xs_dict_get(v, "name");
2100 const xs_dict *replies = xs_dict_get(v, "replies"); 2100 const xs_dict *replies = xs_dict_get(v, "replies");
2101 2101
2102 if (name && replies) { 2102 if (xs_is_string(name) && xs_is_dict(replies)) {
2103 char *ti = (char *)xs_number_str(xs_dict_get(replies, "totalItems")); 2103 const char *ti = xs_number_str(xs_dict_get(replies, "totalItems"));
2104 2104
2105 xs_html_add(poll_result, 2105 if (xs_is_string(ti))
2106 xs_html_tag("tr", 2106 xs_html_add(poll_result,
2107 xs_html_tag("td", 2107 xs_html_tag("tr",
2108 xs_html_text(name), 2108 xs_html_tag("td",
2109 xs_html_text(":")), 2109 xs_html_text(name),
2110 xs_html_tag("td", 2110 xs_html_text(":")),
2111 xs_html_text(ti)))); 2111 xs_html_tag("td",
2112 xs_html_text(ti))));
2112 } 2113 }
2113 } 2114 }
2114 2115