Only try to dereference attrs when enough information is present

This commit is contained in:
Rob Harrington
2015-11-12 09:59:46 +11:00
parent f8a31e8864
commit 86b5e810e5

View File

@@ -8,5 +8,4 @@ angular.module("admin.indexUtils").factory 'Dereferencer', ->
dereferenceAttr: (array, attr, data)->
if array
for object in array
console.log attr, object[attr].id if data[object[attr].id] == undefined
object[attr] = data[object[attr].id]
object[attr] = data[object[attr].id] unless object[attr] == null