aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-05-11 17:33:17 -0700
committerAdam Soltys <[email protected]>2020-05-11 17:33:17 -0700
commitc1c615a8308701f4c20708bf024e83c10bc34f75 (patch)
tree678a1181d299acd86e28328b76d4848789714b17
parent02b41fa0b8009b7bd966787656d5a5d75a8c3ce6 (diff)
downloadcoinos-server-c1c615a8308701f4c20708bf024e83c10bc34f75.tar.gz
coinos-server-c1c615a8308701f4c20708bf024e83c10bc34f75.zip
throw if user not found
-rw-r--r--lib/utils.js1
1 files changed, 1 insertions, 0 deletions
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 });