title: realm null object reference
body: <p>when i start my app with out network and call my data in my database app crash and this is my code </p>
  
  <pre><code> public void getAllMovies() {
      findData = realm.where(MovieDb.class).findAll();
      movieArrayList = new ArrayList(findData);
      movieMethod();
  }
  </code></pre>
  
  <p>and i make my conflagration in here </p>
  
  <pre><code>public class myApplication extends Application {
  
  @Override
  public void onCreate() {
      super.onCreate();
      RealmConfiguration configuration = new RealmConfiguration
              .Builder(this).name("Movie_database.realm").build();
      Realm.setDefaultConfiguration(configuration);}}
  </code></pre>
  
  <p>and moviedb is my realm object<br>
  my app crash in line </p>
  
  <pre><code>    findData = realm.where(MovieDb.class).findAll();
  </code></pre>
  
  <p>and this is my error </p>
  
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
                Process: com.massive.movieapp, PID: 4222
                java.lang.RuntimeException: Unable to start activity ComponentInfo{com.massive.movieapp/com.massive.movieapp.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'io.realm.RealmQuery io.realm.Realm.where(java.lang.Class)' on a null object reference
                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                    at android.app.ActivityThread.-wrap11(ActivityThread.java)
                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                    at android.os.Handler.dispatchMessage(Handler.java:102)
                    at android.os.Looper.loop(Looper.java:148)
                    at android.app.ActivityThread.main(ActivityThread.java:5417)
                    at java.lang.reflect.Method.invoke(Native Method)
                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'io.realm.RealmQuery io.realm.Realm.where(java.lang.Class)' on a null object reference
                    at com.massive.movieapp.FragmentForActivity.getAllMovies(FragmentForActivity.java:143)
                    at com.massive.movieapp.FragmentForActivity.CallNetwork(FragmentForActivity.java:62)
                    at com.massive.movieapp.FragmentForActivity.onCreate(FragmentForActivity.java:55)
                    at android.app.Fragment.performCreate(Fragment.java:2198)
                    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:942)
                    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148)
                    at android.app.BackStackRecord.run(BackStackRecord.java:793)
                    at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1535)
                    at android.app.FragmentController.execPendingActions(FragmentController.java:325)
                    at android.app.Activity.performStart(Activity.java:6252)
                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2379)
                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
                    at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
                    at android.os.Handler.dispatchMessage(Handler.java:102) 
                    at android.os.Looper.loop(Looper.java:148) 
                    at android.app.ActivityThread.main(ActivityThread.java:5417) 
                    at java.lang.reflect.Method.invoke(Native Method
  </code></pre>