diff --git a/package.json b/package.json index b9b917f..a0569c8 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.1.11", + "version": "0.1.12", "name": "superdata", "description": "A ligth weight data layer module motivated by extjs' data layer. It can be used with any client-side framework.", "main": "src/superData.js", diff --git a/src/model/modelObject.js b/src/model/modelObject.js index 4190ff9..c1ab707 100644 --- a/src/model/modelObject.js +++ b/src/model/modelObject.js @@ -24,7 +24,7 @@ module.exports = function createModelObject(options) { throw new Error("options.model.idField is mandatory!"); } - if(!options.data[options.model.idField]) { + if (typeof options.data[options.model.idField] === "undefined") { throw new Error("options.data has to have a property with same name as value of options.model.idField!"); }