aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrunfink <grunfink@noreply.codeberg.org>2026-01-17 05:16:15 +0100
committergrunfink <grunfink@noreply.codeberg.org>2026-01-17 05:16:15 +0100
commit3e95d9639d8da9e5c972ca9424626225f5b7e5b2 (patch)
tree3de92286d5b2f4ae42ac6ba595950688e2e71484
parent5a437c0f1d1e2f590a177e0eb7e13c05958ede4d (diff)
parent84c0ee63cf4a67e7fb8484ef874b121160b63382 (diff)
Merge pull request 'segfault fix' (#521) from byte/snac2:fix_segfault into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/521
-rw-r--r--html.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/html.c b/html.c
index a11b448..b4cb1c7 100644
--- a/html.c
+++ b/html.c
@@ -167,6 +167,7 @@ xs_str *actor_pronouns(xs_dict *actor)
{
const xs_list *attachment;
const xs_dict *d;
+ const char *v;
const char *pronouns = "";
xs_str *ret;
@@ -175,7 +176,9 @@ xs_str *actor_pronouns(xs_dict *actor)
xs *prop = xs_utf8_to_lower(xs_dict_get(d, "name"));
/* make sure that we are reading the correct metadata */
if (strlen(prop) == 8 && strcmp(prop, "pronouns") == 0) {
- pronouns = xs_dict_get(d, "value");
+ /* safeguard from NULL values */
+ v = xs_dict_get(d, "value");
+ pronouns = v ? v : pronouns;
break;
}
}