Null object reference on database cursor : <p>Been trying to retrieve data from database, my database has values and I don't know which causes this error. </p>

<pre><code>public void popList(String date, String time, String type, String game, String place){
    Cursor data = databaseHelper.getReports(date, time, type, game, place);
    while (data.moveToNext()) {
        HashMap&lt;String, String&gt; datax = new HashMap&lt;&gt;();
        datax.put("id", (data.getString(data.getColumnIndex("betid"))));
        datax.put("betnumber", (data.getString(data.getColumnIndex("betnum"))));
        datax.put("betamount", (data.getString(data.getColumnIndex("betamt"))));
        mData3.add(datax);
    }
    bettorAdapter = new MyAdapter(mData3);
    listViewx.setAdapter(bettorAdapter);
    bettorAdapter.notifyDataSetChanged();
}


    public Cursor getReports(String date, String time, String type, String game, String place){
    Cursor data=null;
    try {
    SQLiteDatabase db = this.getReadableDatabase();
    String query = "SELECT * FROM reports WHERE date='"+date+"' AND time ='"+time+"' AND game='"+game+"' AND type='"+type+"' AND lugar='"+place+"'";
    data = db.rawQuery(query,null);
    }catch (Exception e){
        System.out.println(e);
    }
    return data;
}
</code></pre>
