Permalink
Browse files

Make sure only plain javascript object are extended

  • Loading branch information...
jonastreub committed Jul 6, 2017
1 parent b3764ff commit 6e48e0525800fdf8002a995469c3be235d90542d
Showing with 3 additions and 2 deletions.
  1. +3 −2 framer/Utils.coffee
View
@@ -26,8 +26,9 @@ Utils.setValueForKeyPath = (obj, path, val) ->
while i < n and result isnt undefined
field = fields[i]
if i is n - 1
if _.isObject(result[field]) and _.isObject(val)
_.extend(result[field], val)
currentValue = result[field]
if _.isObject(currentValue) and _.isObject(val) and Object.getPrototypeOf(currentValue) is Object.prototype and Object.getPrototypeOf(val) is Object.prototype
_.extend(currentValue, val)
else
result[field] = val
else

0 comments on commit 6e48e05

Please sign in to comment.