title: I could not parse retrofit response
body: <p>I have created a common class to access all POJO classes. when i try to parse and acceess POJO variable i am getting null pointer exception. i really do not know where i was wrong . can anyone help me to resolve this issue?</p>
  
  <p><strong>CommonReponse.java</strong></p>
  
  <pre><code>public class CommonResponse {
  
  private Github github;
  
  public Github getGithub() {
      return github;
  }
  
  public void setGithub(Github github) {
      this.github = github;
  }}
  </code></pre>
  
  <p><strong>GithubService.java</strong></p>
  
  <pre><code>public interface GithubService {
  
  @GET("users/{username}")
  Call&lt;CommonResponse&gt; getGithubUserInfo(@Path("username") String username);}
  </code></pre>
  
  <p><strong>Github.java</strong> // POJO</p>
  
  <pre><code>public class Github {
  
  @SerializedName("name")
  
  private String name;
  
  public String getName() {
      return name;
  }
  public void setName(String name) {
      this.name = name;
  }}
  </code></pre>
  
  <p><strong>GetUserInfo() // Method</strong></p>
  
  <pre><code>   private void getUserInfo() {
      Retrofit retrofit = new Retrofit.Builder()
              .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
              .addConverterFactory(GsonConverterFactory.create())
              .baseUrl("https://api.github.com/")
              .build();
  
      GithubService githubService = retrofit.create(GithubService.class);
      Call&lt;CommonResponse&gt; call = githubService.getGithubUserInfo(mGitUserName);
      call.enqueue(new retrofit2.Callback&lt;CommonResponse&gt;() {
          @Override
          public void onResponse(Call&lt;CommonResponse&gt; call, Response&lt;CommonResponse&gt; response) {
  
              System.out.println("Response:+"+response.body().getGithub().getName());
  
          }
  
          @Override
          public void onFailure(Call&lt;CommonResponse&gt; call, Throwable t) {
              System.out.println("Response error:+"+t.getMessage());
  
          }
      });}
  </code></pre>
  
  <p><strong>log</strong></p>
  
  <pre><code>02-19 15:38:53.926 32293-32293/com.ananth.rxandroidwithretrofit E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                Process: com.ananth.rxandroidwithretrofit, PID: 32293
                                                                                java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.ananth.rxandroidwithretrofit.model.Github.getName()' on a null object reference
                                                                                    at com.ananth.rxandroidwithretrofit.ProfileActivity$7.onResponse(ProfileActivity.java:243)
                                                                                    at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
                                                                                    at android.os.Handler.handleCallback(Handler.java:751)
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                    at android.os.Looper.loop(Looper.java:154)
                                                                                    at android.app.ActivityThread.main(ActivityThread.java:6682)
                                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
  </code></pre>