diff options
| author | default <nobody@localhost> | 2024-11-20 15:59:36 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2024-11-20 15:59:36 +0100 |
| commit | 781c0edcc67b317fbba147a22da614dc3599c0d2 (patch) | |
| tree | b56899116ac92b4adf51cc362d722fca5583d2fc /mastoapi.c | |
| parent | 3a9118524831d1f3a9168034c1655e515f162020 (diff) | |
mastoapi: fixed crash in posts without 'published' field.
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -827,7 +827,16 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg) st = xs_dict_append(st, "url", id); st = xs_dict_append(st, "account", acct); - xs *fd = mastoapi_date(xs_dict_get(msg, "published")); + const char *published = xs_dict_get(msg, "published"); + xs *fd = NULL; + + if (published) + fd = mastoapi_date(published); + else { + xs *p = xs_str_iso_date(0); + fd = mastoapi_date(p); + } + st = xs_dict_append(st, "created_at", fd); { |