         fieldName = reference.name
         continue if not (fieldName of obj)
         values = obj[fieldName]
-        continue if not values?
+        continue if not (values? and values)
         if not angular.isArray(values)
           values = [ values ]
         values_new = []

    _fromObject: (obj) ->
      data = angular.extend({}, @constructor.defaults, obj or {})
      for k, v of data
        if k in ['$meta', 'constructor', '__proto__']
          continue
        @[k] = v
      if @constructor.idField of data

        fieldName = reference.name
        continue if not (fieldName of obj)
        value = obj[fieldName]
        continue if not (value? and value)
        if angular.isObject(value) or (value instanceof Resource)
          obj[fieldName] = if value.$id? then value.$id else null

