Explorar el Código

Null safe access of `id` property, needed as user can be null.

Shane Kilkelly hace 11 años
padre
commit
eab8b4b6c8
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      services/track-changes/app/coffee/UpdatesManager.coffee

+ 1 - 1
services/track-changes/app/coffee/UpdatesManager.coffee

@@ -192,7 +192,7 @@ module.exports = UpdatesManager =
 				# if not, add them to the users list of the earliest update
 				# if not, add them to the users list of the earliest update
 				userExists = false
 				userExists = false
 				for user in earliestUpdate.meta.users
 				for user in earliestUpdate.meta.users
-					if (!user and !update.meta.user) or (user.id == update.meta.user?.id)
+					if (!user and !update.meta.user) or (user?.id == update.meta.user?.id)
 						userExists = true
 						userExists = true
 						break
 						break
 				if !userExists
 				if !userExists