title: Attempt to invoke virtual method-FAILURE : App Crashed
body: <p>While trying to run the app , it crashes and says <code>"Attempt to invoke virtual method"</code>. Below is the error found in the logcat.</p>
  
  <pre><code>FATAL EXCEPTION: main
      Process: com.example.sayantan.moviebugs, PID: 1694
      java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.example.sayantan.moviebugs.model.MoviesResponse.getResults()' on a null object reference
              at com.example.sayantan.moviebugs.MainActivity$2.onResponse(MainActivity.java:132)
              at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
              at android.os.Handler.handleCallback(Handler.java:739)
              at android.os.Handler.dispatchMessage(Handler.java:95)
              at android.os.Looper.loop(Looper.java:168)
              at android.app.ActivityThread.main(ActivityThread.java:5885)
              at java.lang.reflect.Method.invoke(Native Method)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
  </code></pre>
  
  <p>Below is the Json code snippet from <code>main_activity.java</code> file:</p>
  
  <pre><code>eCall&lt;MoviesResponse&gt; call = apiService.getPopularMovies(BuildConfig.THE_MOVIE_DB_API_TOKEN);
          call.enqueue(new Callback&lt;MoviesResponse&gt;() {
              @Override
              public void onResponse(Call&lt;MoviesResponse&gt; call, Response&lt;MoviesResponse&gt; response) {
                  List&lt;Movie&gt; movies = response.body().getResults();
  
                  //Collections.sort(movies, Movie.BY_NAME_ALPHABETICAL);
                  recyclerView.setAdapter(new MoviesAdapter(getApplicationContext(), movies));
                  recyclerView.smoothScrollToPosition(0);
                  if (swipeContainer.isRefreshing()){
                      swipeContainer.setRefreshing(false);
                  }
  </code></pre>
  
  <p>Below is the snippet from the model file :</p>
  
  <pre><code>  public void setPage(int page) {
      this.page = page;
  }
  
  public List&lt;Movie&gt; getResults()
  {
      return results;
  }
  
  public List&lt;Movie&gt; getMovies() {
      return results;
  }
  
  public void setResults(List&lt;Movie&gt; results) {
      this.results = results;
  }
  </code></pre>