From 1eb226ea13fe31f80e1e11a5eed44f6fd4bb0727 Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Sun, 10 Aug 2025 23:26:41 -0700 Subject: [PATCH] Handle mongo count qurey error by returning default value Signed-off-by: Emmanuel Ferdman --- server/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/app.js b/server/app.js index 869fe6555..afba0997b 100644 --- a/server/app.js +++ b/server/app.js @@ -487,8 +487,8 @@ app.get('/account', asyncHandler(async (req, res, next)=>{ const query = { authors: req.account.username, googleId: { $exists: false } }; const mongoCount = await HomebrewModel.countDocuments(query) .catch((err)=>{ - mongoCount = 0; console.log(err); + return 0; }); data.accountDetails = {