title: Attempt to invoke interface method 'boolean java.util.List.add(java.lang.Object)' on a null object reference
body: <p><strong>MainActivity.java</strong> has following code:</p>
  
  <pre><code>package com.softjourn.redmineclient.activities;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.util.Base64;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  import com.google.gson.JsonArray;
  import com.google.gson.JsonParser;
  import com.softjourn.redmineclient.R;
  import com.softjourn.redmineclient.models.Issue;
  import com.softjourn.redmineclient.models.IssuesResponse;
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.net.HttpURLConnection;
  import java.net.ProtocolException;
  import java.net.URL;
  import butterknife.Bind;
  import butterknife.ButterKnife;
  
  public class MainActivity extends AppCompatActivity {
  
  private final static String URI="https://redmineng.softjourn.if.ua/issues.json?assigned_to_id=me";
  @Bind(R.id.list_issues) ListView mListIssues;
  Login li;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      ButterKnife.bind(this);
  
      li = new Login();
      li.execute(URI);
  }
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.menu_main, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
  
      //noinspection SimplifiableIfStatement
      if (id == R.id.action_settings) {
          return true;
      }
  
      return super.onOptionsItemSelected(item);
  }
  
  class Login extends AsyncTask&lt;String, Void, String&gt; {
  
      @Override
      protected String doInBackground(String... strings) {
          HttpURLConnection c = null;
          try {
              c = (HttpURLConnection) new URL(strings[0]).openConnection();
          } catch (IOException e) {
              e.printStackTrace();
          }
          c.setUseCaches(false);
          try {
              c.setRequestMethod("GET");
          } catch (ProtocolException e) {
              e.printStackTrace();
          }
          c.setRequestProperty("Accept", "application/json");
          c.setRequestProperty("Authorization", "basic " + Base64.encodeToString("osavchak:mhgT7322".getBytes(), 0));
          try {
              c.connect();
          } catch (IOException e) {
              e.printStackTrace();
          }
          BufferedReader br = null;
          try {
              br = new BufferedReader(new InputStreamReader((c.getInputStream())));
          } catch (IOException e) {
              e.printStackTrace();
          }
          StringBuilder sb = new StringBuilder();
          String output;
          try {
              while ((output = br.readLine()) != null) {
                  sb.append(output);
              }
          } catch (IOException e) {
              e.printStackTrace();
          }
  
          return sb.toString();
      }
  
      @Override
      protected void onPostExecute(String result) {
          super.onPostExecute(result);
          JsonArray ja = new JsonParser().parse(result).getAsJsonObject().getAsJsonArray("issues");
          IssuesResponse ir = new IssuesResponse(ja);
  
          ArrayAdapter&lt;Issue&gt; adapter = new ArrayAdapter&lt;Issue&gt;(MainActivity.this, android.R.layout.simple_list_item_1, ir.getIssues());
          mListIssues.setAdapter(adapter);
      }
  }
  }
  </code></pre>
  
  <p>I've created two model classes.</p>
  
  <p>First, <strong>IssuesResponse.java</strong>:</p>
  
  <pre><code>package com.softjourn   .redmineclient.models;
  
  import com.google.gson.JsonArray;
  import com.google.gson.JsonElement;
  import com.google.gson.annotations.SerializedName;
  import java.util.List;
  
  public class IssuesResponse {
  @SerializedName("issues")
  private List&lt;Issue&gt; issues;
  
  public IssuesResponse(JsonArray ja) {
      if (issues == null) {
  
      }
      for(JsonElement je : ja) {
          Issue issue = new Issue(je);
          issues.add(issue);
      }
  }
  
  public List&lt;Issue&gt; getIssues() {
      return issues;
  }
  }
  </code></pre>
  
  <p>The second one, <strong>Issue.java</strong>:</p>
  
  <pre><code>package com.softjourn.redmineclient.models;
  
  import com.google.gson.Gson;
  import com.google.gson.JsonElement;
  import com.google.gson.annotations.SerializedName;
  
  public class Issue {
  @SerializedName("id")
  private int id;
  
  @SerializedName("description")
  private String description;
  
  public Issue(JsonElement je) {
      Issue issue = new Gson().fromJson(je,Issue.class);
      this.id = issue.id;
      this.description = issue.description;
  }
  }
  </code></pre>
  
  <p>When I run my application an error occurs:</p>
  
  <blockquote>
    <p>java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.add(java.lang.Object)' on a null object reference
                at com.softjourn.redmineclient.models.IssuesResponse.(IssuesResponse.java:26)
                at com.softjourn.redmineclient.activities.MainActivity$Login.onPostExecute(MainActivity.java:125)
                at com.softjourn.redmineclient.activities.MainActivity$Login.onPostExecute(MainActivity.java:79)
                at android.os.AsyncTask.finish(AsyncTask.java:636)
                at android.os.AsyncTask.access$500(AsyncTask.java:177)
                at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:653)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:135)
                at android.app.ActivityThread.main(ActivityThread.java:5254)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:372)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)</p>
  </blockquote>
  
  <p>I wait for your suggestions how it could be fixed.</p>