diff --git a/api/src/api/accounts.js b/api/src/api/accounts.js index 51c2f22..be475c9 100644 --- a/api/src/api/accounts.js +++ b/api/src/api/accounts.js @@ -86,9 +86,13 @@ async function getAccount(id) { const person = await db.getAPObject(id, 'Person') const username = utils.firstIfArray(person.preferredUsername) const icon = utils.firstIfArray(person.icon) - const newicon = { - type: utils.firstIfArray(icon.mediaType), - url: utils.firstIfArray(icon.url), + var avatar = { type: 'image/png', + url: '/assets/images/default_profile.png' } + if (icon !== null) { + avatar = { + type: utils.firstIfArray(icon.mediaType), + url: utils.firstIfArray(icon.url), + } } var props = {} if (person.attachment !== undefined) { @@ -120,7 +124,7 @@ async function getAccount(id) { acct: username+'@'+(new URL(person.id)).hostname, name: utils.firstIfArray(person.name), summary: utils.firstIfArray(person.summary), - avatar: newicon, + avatar, username, props, }