diff options
| author | 2023-04-23 15:23:20 +0200 | |
|---|---|---|
| committer | 2023-04-23 15:23:20 +0200 | |
| commit | 177bf03e100216a604eda82400c03d006978d2bc (patch) | |
| tree | 92525f466f0e1f7cf3e2dc4b0e4c19234808f58d | |
| parent | Fixed a bug in the instance timeline. (diff) | |
| download | snac2-177bf03e100216a604eda82400c03d006978d2bc.tar.gz snac2-177bf03e100216a604eda82400c03d006978d2bc.tar.xz snac2-177bf03e100216a604eda82400c03d006978d2bc.zip | |
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) | |||
| 456 | acct = xs_dict_append(acct, "created_at", date); | 456 | acct = xs_dict_append(acct, "created_at", date); |
| 457 | } | 457 | } |
| 458 | 458 | ||
| 459 | acct = xs_dict_append(acct, "note", xs_dict_get(actor, "summary")); | 459 | const char *note = xs_dict_get(actor, "summary"); |
| 460 | if (xs_is_null(note)) | ||
| 461 | note = ""; | ||
| 462 | |||
| 463 | acct = xs_dict_append(acct, "note", note); | ||
| 464 | |||
| 460 | acct = xs_dict_append(acct, "url", id); | 465 | acct = xs_dict_append(acct, "url", id); |
| 461 | 466 | ||
| 462 | xs *avatar = NULL; | 467 | xs *avatar = NULL; |