title: sqlite.get() results in TypeError: Cannot read property 'get' of null
body: <p>When trying to execute a sql.get() call it works in some places, but not in others and I can't seem to figure out what's the difference.<br>
  The database is sucessfully opened or at least I never got an error and it never gets closed. I also use Discord.js in the second (working example), not sure if that is relevant, though.<br>
  In this example it doesn't work.<br>
  test.js:</p>
  
  <pre><code>const sql = require("sqlite");
  sql.open("./data.sqlite");
  
  exports.getItemID = function(item) {
      return new Promise(function (fulfill, reject){
          sql.get(`SELECT * FROM items WHERE name="${item}"`).then(row =&gt; {
              console.log(`do stuff`);
          }).catch((e) =&gt; {
              console.error;
              reject(e);
          })
      });
  }
  
  exports.getItemID("Coins").then(itemID =&gt; {
      console.log(itemID);
  }).catch((e) =&gt; {
      console.log(e);
  });
  </code></pre>
  
  <p>Stacktrace:  </p>
  
  <pre><code>$ node test.js 
  TypeError: Cannot read property 'get' of null
      at Promise (/Users/julianveerkamp/node_modules/sqlite/main.js:225:18)
      at Promise (&lt;anonymous&gt;)
      at Database.get (/Users/julianveerkamp/node_modules/sqlite/main.js:224:12)
      at /Users/julianveerkamp/workspace/test-bot/test.js:6:13
      at Promise (&lt;anonymous&gt;)
      at Object.exports.getItemID (/Users/julianveerkamp/workspace/test-bot/test.js:5:12)
      at Object.&lt;anonymous&gt; (/Users/julianveerkamp/workspace/test-bot/test.js:15:9)
      at Module._compile (module.js:573:30)
      at Object.Module._extensions..js (module.js:584:10)
      at Module.load (module.js:507:32)
  </code></pre>
  
  <p>But when I call a function with </p>
  
  <pre><code>const sql = require("sqlite");
  sql.open("./data.sqlite");
  // other stuff
  let commandFile = require(`./commands/command.js`);
  commandFile.run(client, message, args);
  // other stuff
  </code></pre>
  
  <p>it works just fine. </p>
  
  <p>command.js:</p>
  
  <pre><code>const sql = require("sqlite");
  sql.open("./data.sqlite");
  
  exports.run = (client, message, args) =&gt; {
      sql.get(`SELECT * FROM scores WHERE userID ="${message.author.id}"`).then(row =&gt; {
          // Do stuff with row
      }).catch(() =&gt; {
          console.error;
      });
  }
  </code></pre>