diff options
| author | Adam Soltys <[email protected]> | 2020-05-11 17:33:17 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-05-11 17:33:17 -0700 |
| commit | c1c615a8308701f4c20708bf024e83c10bc34f75 (patch) | |
| tree | 678a1181d299acd86e28328b76d4848789714b17 /lib | |
| parent | 02b41fa0b8009b7bd966787656d5a5d75a8c3ce6 (diff) | |
| download | coinos-server-c1c615a8308701f4c20708bf024e83c10bc34f75.tar.gz coinos-server-c1c615a8308701f4c20708bf024e83c10bc34f75.zip | |
throw if user not found
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/utils.js | 1 |
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 }); |
