From c1c615a8308701f4c20708bf024e83c10bc34f75 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 11 May 2020 17:33:17 -0700 Subject: throw if user not found --- lib/utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/utils.js b/lib/utils.js index cd1b3d69..5674f2fc 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -22,6 +22,7 @@ getUser = async (username, transaction) => { } let user = await db.User.findOne(params); + if (!user) throw new Error("User not found"); user = user.get({ plain: true }); -- cgit v1.2.3