title: Realm query equalTo results in nullpointerexception
body: <p>I'm trying to make a query in realm. But I keep getting a null pointer exception in equalTo("id", 38) </p>
  
  <p>This is the exception:</p>
  
  <pre><code>Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object java.util.Map.get(java.lang.Object)' on a null object reference
      at io.realm.RealmQuery.getColumnIndices(RealmQuery.java:140)
      at io.realm.RealmQuery.equalTo(RealmQuery.java:199)
      at es.treenovum.paedocuments.services.OfflineService$WidgetOpsNewest.loadTags(OfflineService.java:340)
      at es.treenovum.paedocuments.services.OfflineService$WidgetOpsNewest.doInBackground(OfflineService.java:228)
      at es.treenovum.paedocuments.services.OfflineService$WidgetOpsNewest.doInBackground(OfflineService.java:1)
      at android.os.AsyncTask$2.call(AsyncTask.java:288)
      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
      ... 3 more
  </code></pre>
  
  <p>The exception happens on the equalTo line here:</p>
  
  <pre><code>Category categoryResult = realm.where(Category.class)
        .equalTo("id", category.getId())
        .findFirst();
  </code></pre>
  
  <p>The int category.getId() is not null or empty. realm neither. </p>
  
  <p>If its the first time I run the app the db is empty. Would that cause this? Shouldn't there return null or 0 in result instead of throwing an exception?</p>
  
  <p>EDIT: Category Class added. All getters and setters generated by eclipse.</p>
  
  <pre><code>import io.realm.RealmObject;
  import io.realm.annotations.RealmClass;
  
  import com.google.gson.annotations.SerializedName;
  
  @RealmClass
  public class Category extends RealmObject {
  
      @SerializedName("id")
      private int id;
  
      @SerializedName("text")
      private String text;
  
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      public String getText() {
          return text;
      }
  
      public void setText(String text) {
          this.text = text;
      }
  }
  </code></pre>