mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 06:23:41 -04:00
Fix error handling callback
This commit is contained in:
parent
846fb987d2
commit
7186bd5592
1 changed files with 1 additions and 1 deletions
|
@ -249,7 +249,7 @@ module.exports = class Handler
|
|||
criteria = {}
|
||||
criteria[if nonVersioned then '_id' else 'original'] = mongoose.Types.ObjectId(id)
|
||||
@modelClass.findOne(criteria, project).sort(sort).exec (err, document) ->
|
||||
return done(err) if err
|
||||
return callback err if err
|
||||
callback(null, document?.toObject() or null)
|
||||
|
||||
funcs = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue