mirror of https://github.com/status-im/codimd.git
Merge pull request #714 from SISheogorath/fix/uncaughtException
Fix uncaught exception for non-existent user
This commit is contained in:
commit
2024262200
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue