Use _.isObject instead of typeof.

This commit is contained in:
Brad Dunbar
2012-12-26 09:30:24 -05:00
parent c396adb2dd
commit 7fe4138b65

View File

@@ -461,7 +461,9 @@
model.attributes = attributes;
var serverAttrs = model.parse(resp, options);
if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
if (typeof serverAttrs === 'object' && !model.set(serverAttrs, options)) return false;
if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {
return false;
}
if (success) success(model, resp, options);
};