diff --git a/lib/models/index.js b/lib/models/index.js index 0d67f86..fe31a7b 100644 --- a/lib/models/index.js +++ b/lib/models/index.js @@ -19,7 +19,8 @@ function initDb(_a) { var dbConfig = _a.dbConfig, sequelizeInstance = _a.sequelizeInstance; var basename = path_1["default"].basename(module.filename); db = {}; - if (typeof dbConfig.use_env_variable !== 'undefined' && + if (dbConfig && + typeof dbConfig.use_env_variable !== 'undefined' && dbConfig.use_env_variable && !sequelizeInstance) { sequelizeInstance = new sequelize_1.Sequelize();