Fix crash in `id(model, property)`
Before this change, an attempt to save a model instance with a dynamic property to a MySQL datasource crashed the application. This commit fixes the implementation of `id(model, property)` to correctly handle the case when the property is not described in the model definition.
This commit is contained in:
parent
f58d3c82e3
commit
1eb6d79b97
|
@ -104,10 +104,7 @@ Connector.prototype.idNames = function (model) {
|
||||||
*/
|
*/
|
||||||
Connector.prototype.id = function (model, prop) {
|
Connector.prototype.id = function (model, prop) {
|
||||||
var p = this._models[model].properties[prop];
|
var p = this._models[model].properties[prop];
|
||||||
if (!p) {
|
return p && p.id;
|
||||||
console.trace('Property not found: ' + model + '.' + prop);
|
|
||||||
}
|
|
||||||
return p.id;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue