diff --git a/common/models/role.js b/common/models/role.js index 595b4eac..7dc45dea 100644 --- a/common/models/role.js +++ b/common/models/role.js @@ -104,8 +104,11 @@ module.exports = function(Role) { }); function isUserClass(modelClass) { - return modelClass === loopback.User || - modelClass.prototype instanceof loopback.User; + if (modelClass) { + return modelClass === loopback.User || + modelClass.prototype instanceof loopback.User; + } + else return false; } /*!