فهرست منبع

Safe access to potentially-null project

Shane Kilkelly 9 سال پیش
والد
کامیت
bb0dad3353
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      services/web/app/coffee/Features/Editor/EditorHttpController.coffee

+ 1 - 1
services/web/app/coffee/Features/Editor/EditorHttpController.coffee

@@ -23,7 +23,7 @@ module.exports = EditorHttpController =
 		EditorHttpController._buildJoinProjectView req, project_id, user_id, (error, project, privilegeLevel) ->
 			return next(error) if error?
 			# Hide access tokens if this is not the project owner
-			if privilegeLevel != 'owner' && project.tokens?
+			if privilegeLevel != 'owner' && project?.tokens?
 				project.tokens = {readOnly: '', readAndWrite: ''}
 			res.json {
 				project: project