From 177bf03e100216a604eda82400c03d006978d2bc Mon Sep 17 00:00:00 2001 From: default Date: Sun, 23 Apr 2023 15:23:20 +0200 Subject: Fixed bad JSON for accounts that do not have a 'summary' field. --- mastoapi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mastoapi.c') diff --git a/mastoapi.c b/mastoapi.c index e52f86b..06ec915 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -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; -- cgit v1.2.3