fix(model-builder): __data may be null. (#1415)
This error was swallowed by strong-remoting try/catch in eachRemoteFunctionInObject()
This commit is contained in:
parent
7c196af109
commit
40e278ab96
|
@ -303,7 +303,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
|
|||
Object.defineProperty(ModelClass.prototype, 'id', {
|
||||
get: function() {
|
||||
var idProp = ModelClass.definition.idNames()[0];
|
||||
return this.__data[idProp];
|
||||
return this.__data && this.__data[idProp];
|
||||
},
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
|
@ -317,7 +317,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
|
|||
var idNames = ModelClass.definition.idNames();
|
||||
for (var i = 0, p; i < idNames.length; i++) {
|
||||
p = idNames[i];
|
||||
compositeId[p] = this.__data[p];
|
||||
compositeId[p] = this.__data && this.__data[p];
|
||||
}
|
||||
return compositeId;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue