mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-31 07:12:49 -04:00
Fix potential undefined error in logging
This commit is contained in:
parent
438e8e426c
commit
8bb5251797
1 changed files with 1 additions and 1 deletions
|
@ -97,7 +97,7 @@ ClassroomHandler = class ClassroomHandler extends Handler
|
|||
get: (req, res) ->
|
||||
if ownerID = req.query.ownerID
|
||||
unless req.user and (req.user.isAdmin() or ownerID is req.user.id)
|
||||
log.debug "classroom_handler.get: ownerID (#{ownerID}) must be yourself (#{req.user.id})"
|
||||
log.debug "classroom_handler.get: ownerID (#{ownerID}) must be yourself (#{req.user?.id})"
|
||||
return @sendForbiddenError(res)
|
||||
return @sendBadInputError(res, 'Bad ownerID') unless utils.isID ownerID
|
||||
Classroom.find {ownerID: mongoose.Types.ObjectId(ownerID)}, (err, classrooms) =>
|
||||
|
|
Loading…
Add table
Reference in a new issue