diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 12991a4ca..1147d3504 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -154,7 +154,7 @@ const api = { throw { name: 'BrewLoad Error', message: 'Brew not found', status: 404, HBErrorCode: '05', accessType: accessType, brewId: id }; } - const userID = accessType === 'edit' ? req.account.username : stub.authors[0]; + const userID = req?.account?.username && (accessType === 'edit') ? req.account.username : stub.authors[0]; // Clean up brew: fill in missing fields with defaults / fix old invalid values const userThemes = await getUsersBrewThemes(userID, id);