mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Fix potential undefined error in logging
This commit is contained in:
parent
5fcc3669af
commit
438e8e426c
1 changed files with 1 additions and 1 deletions
|
@ -105,7 +105,7 @@ ClassroomHandler = class ClassroomHandler extends Handler
|
|||
return @sendSuccess(res, (@formatEntity(req, classroom) for classroom in classrooms))
|
||||
else if memberID = req.query.memberID
|
||||
unless req.user and (req.user.isAdmin() or memberID is req.user.id)
|
||||
log.debug "classroom_handler.get: memberID (#{memberID}) must be yourself (#{req.user.id})"
|
||||
log.debug "classroom_handler.get: memberID (#{memberID}) must be yourself (#{req.user?.id})"
|
||||
return @sendForbiddenError(res)
|
||||
return @sendBadInputError(res, 'Bad memberID') unless utils.isID memberID
|
||||
Classroom.find {members: mongoose.Types.ObjectId(memberID)}, (err, classrooms) =>
|
||||
|
|
Loading…
Reference in a new issue