0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-01 13:02:43 +00:00

Fix empty Google Brews crashing user page

This commit is contained in:
Trevor Buckner
2021-06-11 13:46:03 -04:00
parent 4d5653854a
commit 9d80f21ae7
2 changed files with 3 additions and 1 deletions

View File

@@ -151,7 +151,8 @@ app.get('/user/:username', async (req, res, next)=>{
console.error(err); console.error(err);
}); });
brews = _.concat(brews, googleBrews); if(googleBrews)
brews = _.concat(brews, googleBrews);
} }
req.brews = _.map(brews, (brew)=>{ req.brews = _.map(brews, (brew)=>{

View File

@@ -100,6 +100,7 @@ GoogleActions = {
}) })
.catch((err)=>{ .catch((err)=>{
return console.error(`Error Listing Google Brews: ${err}`); return console.error(`Error Listing Google Brews: ${err}`);
//TODO: Should break out here, but continues on for some reason.
}); });
if(!obj.data.files.length) { if(!obj.data.files.length) {