diff options
| author | default <nobody@localhost> | 2023-04-23 15:23:20 +0200 |
|---|---|---|
| committer | default <nobody@localhost> | 2023-04-23 15:23:20 +0200 |
| commit | 177bf03e100216a604eda82400c03d006978d2bc (patch) | |
| tree | 92525f466f0e1f7cf3e2dc4b0e4c19234808f58d | |
| parent | 04ba2818cb3c6e0054d9f97c1ae5efaae6c8d1b5 (diff) | |
Fixed bad JSON for accounts that do not have a 'summary' field.
| -rw-r--r-- | mastoapi.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -456,7 +456,12 @@ xs_dict *mastoapi_account(const xs_dict *actor) acct = xs_dict_append(acct, "created_at", date); } - acct = xs_dict_append(acct, "note", xs_dict_get(actor, "summary")); + const char *note = xs_dict_get(actor, "summary"); + if (xs_is_null(note)) + note = ""; + + acct = xs_dict_append(acct, "note", note); + acct = xs_dict_append(acct, "url", id); xs *avatar = NULL; |