diff options
author | default <nobody@localhost> | 2024-07-11 09:26:26 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2024-07-11 09:26:26 +0200 |
commit | 5a421847a7d090f7736498b449b1571bc0c4c226 (patch) | |
tree | 4811f34dcf67fc874ff8af788975fffef6ca291d /html.c | |
parent | a7344d20a45ef414121f3fef31aaec32ac54dab7 (diff) |
Do nothing on polls without any vote.
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -3442,15 +3442,16 @@ int html_post_handler(const xs_dict *req, const char *q_path, /* multiple choices? */ if (xs_type(opt) == XSTYPE_LIST) ls = xs_dup(opt); - else { + else + if (xs_type(opt) == XSTYPE_STRING) { ls = xs_list_new(); ls = xs_list_append(ls, opt); } - xs_list *p = ls; const xs_str *v; + int c = 0; - while (xs_list_iter(&p, &v)) { + while (xs_list_next(ls, &v, &c)) { xs *msg = msg_note(&snac, "", actor, irt, NULL, 1); /* set the option */ @@ -3463,7 +3464,7 @@ int html_post_handler(const xs_dict *req, const char *q_path, timeline_add(&snac, xs_dict_get(msg, "id"), msg); } - { + if (ls != NULL) { /* get the poll object */ xs *poll = NULL; |