From 438e8e426ce1329ccf0130a61fb5a3a756203b12 Mon Sep 17 00:00:00 2001 From: phoenixeliot Date: Fri, 27 May 2016 11:22:33 -0700 Subject: [PATCH] Fix potential undefined error in logging --- server/handlers/classroom_handler.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/handlers/classroom_handler.coffee b/server/handlers/classroom_handler.coffee index 0fe8b8387..40b8055f6 100644 --- a/server/handlers/classroom_handler.coffee +++ b/server/handlers/classroom_handler.coffee @@ -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) =>