title: Node sequelize throwing undefined error when checking if an object exists
body: <p>Ok, so this is either very weird or I'm not understanding something that is happening. I am trying to load the sequelize library in node.</p>
  
  <p>when trying to connect I'm using the CLI generated index.js file however this line:</p>
  
  <pre><code>if (config.use_env_variable) {
      console.log('i ran');
    var sequelize = new Sequelize(process.env[config.use_env_variable], config);
  } else {
        var sequelize = new Sequelize(config.db.database, config.db.username, config.db.password, {
        dialect:config.db.dialect});
  }
  </code></pre>
  
  <p>is giving me this error:</p>
  
  <pre><code>Cannot read property 'use_env_variable' of undefined
  </code></pre>
  
  <p>as far as I know that line is meant to see if this even returns anything so I don't understand why this is throwing that error?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>config is invoked in a line above it, the whole file up to that point is:</p>
  
  <pre><code>'use strict';
  
  var fs        = require('fs');
  var path      = require('path');
  var Sequelize = require('sequelize');
  var basename  = path.basename(__filename);
  const config    = require(path.join(__dirname,'../config/config.js'));
  const db        = {};
  
  console.log(config);
  
  
  if (config.use_env_variable) {
      console.log('i ran');
    var sequelize = new Sequelize(process.env[config.use_env_variable], config);
  } else {
        var sequelize = new Sequelize(config.db.database, config.db.username, config.db.password, {
        dialect:config.db.dialect});
  }
  </code></pre>
  
  <p><strong>UPDATE added console.log of config on working version</strong></p>