commit 84c0ee6

byte  ·  2026-01-17 02:49:56 +0000 UTC
parent 5a437c0
segfault fix
1 files changed,  +4, -1
M html.c
M html.c
+4, -1
 1@@ -167,6 +167,7 @@ xs_str *actor_pronouns(xs_dict *actor)
 2 {
 3     const xs_list *attachment;
 4     const xs_dict *d;
 5+    const char *v;
 6     const char *pronouns = "";
 7     xs_str *ret;
 8 
 9@@ -175,7 +176,9 @@ xs_str *actor_pronouns(xs_dict *actor)
10             xs *prop = xs_utf8_to_lower(xs_dict_get(d, "name"));
11             /* make sure that we are reading the correct metadata */
12             if (strlen(prop) == 8 && strcmp(prop, "pronouns") == 0) {
13-                pronouns = xs_dict_get(d, "value");
14+                /* safeguard from NULL values */
15+                v = xs_dict_get(d, "value");
16+                pronouns = v ? v : pronouns;
17                 break;
18             }
19         }