mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-26 01:03:37 +00:00
Fixed crash.
This commit is contained in:
parent
fbb773ae72
commit
8018f8c1d4
1 changed files with 8 additions and 3 deletions
11
mastoapi.c
11
mastoapi.c
|
@ -531,9 +531,14 @@ xs_dict *mastoapi_account(const xs_dict *actor)
|
|||
xs *avatar = NULL;
|
||||
xs_dict *av = xs_dict_get(actor, "icon");
|
||||
|
||||
if (xs_type(av) == XSTYPE_DICT)
|
||||
avatar = xs_dup(xs_dict_get(av, "url"));
|
||||
else
|
||||
if (xs_type(av) == XSTYPE_DICT) {
|
||||
char *url = xs_dict_get(av, "url");
|
||||
|
||||
if (url != NULL)
|
||||
avatar = xs_dup(url);
|
||||
}
|
||||
|
||||
if (avatar == NULL)
|
||||
avatar = xs_fmt("%s/susie.png", srv_baseurl);
|
||||
|
||||
acct = xs_dict_append(acct, "avatar", avatar);
|
||||
|
|
Loading…
Reference in a new issue