Skip to content

Commit

Permalink
fix: ensure fallback is present
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jan 7, 2022
1 parent 1dc9d18 commit a50d505
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/avatar/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ module.exports = fn => async (req, res) => {
}

if (value === undefined) {
value = { type: 'url', data: getFallbackUrl({ query, protocol, host }) }
const fallback = getFallbackUrl({ query, protocol, host })
value = fallback ? { type: 'url', fallback } : null
}

return {
Expand Down

1 comment on commit a50d505

@vercel
Copy link

@vercel vercel bot commented on a50d505 Jan 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.