profiles: catches error case

This commit is contained in:
@wwwjim 2020-07-22 04:32:08 -07:00
parent acbadad710
commit 0c1faa991a

View File

@ -58,12 +58,13 @@ app.prepare().then(async () => {
return app.render(req, res, "/profile", {
viewer,
creator: creator
? {
username: creator.username,
data: { photo: creator.data.photo },
}
: null,
creator:
creator && !creator.error
? {
username: creator.username,
data: { photo: creator.data.photo },
}
: null,
});
});