diff options
| author | 2026-02-14 16:46:09 +0100 | |
|---|---|---|
| committer | 2026-02-14 16:46:09 +0100 | |
| commit | 3907b009769cea893b0093385239e948a9c3946b (patch) | |
| tree | e534230645e7a63bba06985b863a9ab3fef1210b | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-3907b009769cea893b0093385239e948a9c3946b.tar.gz snac2-3907b009769cea893b0093385239e948a9c3946b.tar.xz snac2-3907b009769cea893b0093385239e948a9c3946b.zip | |
Fixed crash when the 'url' field is a list.
| -rw-r--r-- | html.c | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -275,6 +275,13 @@ xs_html *html_actor_icon(snac *user, xs_dict *actor, const char *date, | |||
| 275 | 275 | ||
| 276 | const char *actor_id = xs_dict_get(actor, "id"); | 276 | const char *actor_id = xs_dict_get(actor, "id"); |
| 277 | const char *html_url = xs_dict_get_def(actor, "url", actor_id); | 277 | const char *html_url = xs_dict_get_def(actor, "url", actor_id); |
| 278 | |||
| 279 | if (xs_is_list(html_url)) | ||
| 280 | html_url = xs_list_get(html_url, 0); | ||
| 281 | |||
| 282 | if (!xs_is_string(html_url)) | ||
| 283 | html_url = actor_id; | ||
| 284 | |||
| 278 | xs *href = NULL; | 285 | xs *href = NULL; |
| 279 | 286 | ||
| 280 | if (user) { | 287 | if (user) { |