title: I keep getting an NPE when checking for a sqlite table
body: <p>I'm trying to check to see if a table exists in and SQLite Database with Android using this in my SQLiteOpenHelper file</p>
  
  <pre><code>// Check to see if a table exists
  public boolean isTableExists(String tblName) {
      String existQuery = "SELECT name FROM sqlite_master WHERE name ='" + tblName + "' and type='table'";
      SQLiteDatabase db = this.getReadableDatabase();
      Cursor cursor = db.rawQuery(existQuery, null);
  
      if(cursor != null){
          cursor.close();
          return true;
      }
  
      return false;
  
  }
  </code></pre>
  
  <p>The call from my Activity is</p>
  
  <pre><code>if(db.isTableExists("characters") == false){
          Intent p = new Intent("com.tml.rpgtodo.CREATECHARACTER");
          startActivity(p);
      }
  </code></pre>
  
  <p>I keep getting a NullPointerException on the row with the if statement. What am I doing wrong?</p>