mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-10 03:50:38 +03:00
Fixed crash.
This commit is contained in:
parent
fbb773ae72
commit
8018f8c1d4
11
mastoapi.c
11
mastoapi.c
@ -531,9 +531,14 @@ xs_dict *mastoapi_account(const xs_dict *actor)
|
|||||||
xs *avatar = NULL;
|
xs *avatar = NULL;
|
||||||
xs_dict *av = xs_dict_get(actor, "icon");
|
xs_dict *av = xs_dict_get(actor, "icon");
|
||||||
|
|
||||||
if (xs_type(av) == XSTYPE_DICT)
|
if (xs_type(av) == XSTYPE_DICT) {
|
||||||
avatar = xs_dup(xs_dict_get(av, "url"));
|
char *url = xs_dict_get(av, "url");
|
||||||
else
|
|
||||||
|
if (url != NULL)
|
||||||
|
avatar = xs_dup(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (avatar == NULL)
|
||||||
avatar = xs_fmt("%s/susie.png", srv_baseurl);
|
avatar = xs_fmt("%s/susie.png", srv_baseurl);
|
||||||
|
|
||||||
acct = xs_dict_append(acct, "avatar", avatar);
|
acct = xs_dict_append(acct, "avatar", avatar);
|
||||||
|
Loading…
Reference in New Issue
Block a user