Merge pull request #714 from SISheogorath/fix/uncaughtException

Fix uncaught exception for non-existent user
This commit is contained in:
Christoph (Sheogorath) Kern 2018-01-31 20:48:59 +01:00 committed by GitHub
commit 2024262200
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -21,6 +21,11 @@ passport.deserializeUser(function (id, done) {
id: id id: id
} }
}).then(function (user) { }).then(function (user) {
// Don't die on non-existent user
if (user == null) {
return done(null, false, { message: 'Invalid UserID' })
}
logger.info('deserializeUser: ' + user.id) logger.info('deserializeUser: ' + user.id)
return done(null, user) return done(null, user)
}).catch(function (err) { }).catch(function (err) {