Closed smart--petea closed 10 years ago
When there are no database connection the variable this.dbmodels is undefined and as result the snippet this.dbmodels[modelName] throw an error. This is from
this.dbmodels
this.dbmodels[modelName]
Vatican.prototype.getCorrectModel = function(handler) { var modelName = handler.handlerName.replace("Hdlr", '') return this.dbmodels[modelName] }
Maybe to write this function in the form
Vatican.prototype.getCorrectModel = function(handler) { if( this.dbmodels ) { var modelName = handler.handlerName.replace("Hdlr", '') return this.dbmodels[modelName] } return false; }
When there are no database connection the variable
this.dbmodels
is undefined and as result the snippetthis.dbmodels[modelName]
throw an error. This is fromMaybe to write this function in the form