Check if data is an object

I couldn't reproduce it locally, but I got this exception once. This
implementation will need to be rewritten after upgrading to newest
ember, so I'll leave it as it is for now.
This commit is contained in:
Piotr Sarnacki 2012-10-31 00:42:17 +01:00
parent e897008a2d
commit baa95d590d

View File

@ -41,7 +41,7 @@ Travis.Store = DS.Store.extend
recordCache = @get('recordCache')
if clientId != undefined
if data = dataCache[clientId]
if (data = dataCache[clientId]) && (typeof data == 'object')
for key, value of hash
if ( descriptor = Object.getOwnPropertyDescriptor(data, key) ) && descriptor.set
Ember.set(data, key, value)