title: 'boolean java.util.ArrayList.isEmpty()' on a null object reference
body: <p>I am trying to do 2 differents calls on the same recycle view, the idea is to get data from 2 differents request and to show the shield of the validated team with the id of a football match. I know what the error means, but, I really do not know how to fix it. The JSON file are valid and this is the error.</p>
  
  <pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
                    Process: com.example.cristhian.consumingapi, PID: 16520
                    java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.util.ArrayList.isEmpty()' on a null object reference
                        at com.example.cristhian.consumingapi.ListaPartidosAdapter.setupAdapter(ListaPartidosAdapter.java:99)
                        at com.example.cristhian.consumingapi.ListaPartidosAdapter.adicionarListaPartidos(ListaPartidosAdapter.java:89)
                        at com.example.cristhian.consumingapi.MainActivity$1.onResponse(MainActivity.java:76)
                        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:6119)
                        at java.lang.reflect.Method.invoke(Native Method)
                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
  Application terminated.
  </code></pre>
  
  <p><strong>ListaPartidosAdapter</strong></p>
  
  <pre><code>public class ListaPartidosAdapter extends RecyclerView.Adapter&lt;ListaPartidosAdapter.ViewHolder&gt; {
  
      private static final String TAG = "Football_Adapter";
      private ArrayList&lt;Partido&gt; dataset;
      private ArrayList&lt;Stand&gt; dataset_Stand;
      private Context context;
  
      public ListaPartidosAdapter(Context context) {
          this.context = context;
          dataset = new ArrayList&lt;Partido&gt;();
          dataset_Stand = new ArrayList&lt;Stand&gt;();
      }
  
      @Override
      public ListaPartidosAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_partidos, parent, false);
          return new ViewHolder(view);
      }   
  
      @Override
      public void onBindViewHolder(ListaPartidosAdapter.ViewHolder holder, int position) {
          Partido p = dataset.get(position);
          String status = p.getStatus();
  
          if (status.equals("SCHEDULED")){
              String status_ = "SCH";
              holder.status.setText(status_);
          }
          holder.utcDate.setText(p.getUtcDate());    
          Partido.EquipoCasa homeTeam = p.getHomeTeam();
          String id_homeTeam = homeTeam.getId();    
          holder.homeTeam.setText(homeTeam.getName());    
          Partido.EquipoVisita awayTeam = p.getAwayTeam();
          holder.awayTeam.setText(awayTeam.getName());    
          Stand s = dataset_Stand.get(position);
          Stand.Table table = (Stand.Table) s.getTable();
          Stand.Table.Equipo team = (Stand.Table.Equipo) table.getEquipo();
          String id_equipo = team.getId();
          holder.homeTeam.setText(team.getName());   
  
          if(id_homeTeam.equals(id_equipo)){
              Glide.with(context)
                  .load(team.getCrestUrl())
                  .centerCrop()
                  .crossFade()
                  .diskCacheStrategy(DiskCacheStrategy.ALL)
                  .into(holder.team);
          }   
      }    
      @Override
      public int getItemCount() {
          return 0;
      }    
      public void adicionarListaPartidos(ArrayList&lt;Partido&gt; listaPartidos){
          setupAdapter(listaPartidos, null);
      }
  
      public void adicionarListaStands(ArrayList&lt;Stand&gt; listaStands){
          setupAdapter(null, listaStands);
      }
  
      private void setupAdapter(ArrayList&lt;Partido&gt; listaPartidos, ArrayList&lt;Stand&gt; listaStands) {
          if(!listaPartidos.isEmpty() &amp;&amp; !listaStands.isEmpty()){
              addItemsToAdapter(listaPartidos,listaStands);
          }
      }
  
      public void addItemsToAdapter(ArrayList&lt;Partido&gt; listaPartidos, ArrayList&lt;Stand&gt; listaStands){
          notifyDataSetChanged();
      }
  
      public class ViewHolder extends RecyclerView.ViewHolder {    
          private TextView status;
          private TextView utcDate;
          private TextView homeTeam;
          private TextView awayTeam;
          public ImageView team;    
  
          public ViewHolder(View itemView) {
              super(itemView);
  
              status = (TextView) itemView.findViewById(R.id.status);
              utcDate = (TextView) itemView.findViewById(R.id.utcDate);
              homeTeam = (TextView) itemView.findViewById(R.id.homeTeam);
              awayTeam = (TextView) itemView.findViewById(R.id.awayTeam);
              team = (ImageView) itemView.findViewById(R.id.team);
          }
      }
  }
  </code></pre>
  
  <p>And this is my MainActivity.java.</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      private Retrofit retrofit;
      private static final String TAG = "Football";
      private RecyclerView recyclerView;
      private ListaPartidosAdapter listaPartidosAdapter;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          recyclerView = (RecyclerView)findViewById(R.id.recyclerView);
          listaPartidosAdapter = new ListaPartidosAdapter(this);
          recyclerView.setAdapter(listaPartidosAdapter);
          recyclerView.setHasFixedSize(true);
          final LinearLayoutManager layoutManager = new LinearLayoutManager(this, VERTICAL, true);
          recyclerView.setLayoutManager(layoutManager);
  
          retrofit = new Retrofit.Builder()
                  .baseUrl("http://api.football-data.org/v2/")
                  .addConverterFactory(GsonConverterFactory.create())
                  .build();
  
          obtenerDatos();
      }
  
      private void obtenerDatos() {
  
          Calendar calendar = Calendar.getInstance();
          SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
          String todayDate=df.format(calendar.getTime());
          calendar.add(Calendar.DATE,3);
          String endDate = df.format(calendar.getTime());
  
          Log.i(TAG, "todayDate : " + todayDate);
          Log.i(TAG, "endDate : " + endDate);
  
          footballdataService service = retrofit.create(footballdataService.class);
          Call&lt;PartidosRespuesta&gt; partidosRespuestaCall = service.obtenerlistaPartidos(todayDate,endDate);
          Call&lt;StandingsRespuesta&gt; standingsRespuestaCall = service.obtenerStandings();
  
          partidosRespuestaCall.enqueue(new Callback&lt;PartidosRespuesta&gt;() {
              @Override
              public void onResponse(Call&lt;PartidosRespuesta&gt; call, Response&lt;PartidosRespuesta&gt; response) {
                  if(response.isSuccessful()) {
                      PartidosRespuesta partidosRespuesta = response.body();
                      List&lt;Partido&gt; listaPartidos = partidosRespuesta.getMatches();
                      listaPartidosAdapter.adicionarListaPartidos((ArrayList&lt;Partido&gt;) listaPartidos);
  
                  }
                  else {
                      Log.e(TAG, "onResponse: " + response.errorBody());
                  }
              }
  
              @Override
              public void onFailure(Call&lt;PartidosRespuesta&gt; call, Throwable t) {
                  Log.e(TAG, "onFailure: " + t.getMessage());
              }
          });
  
          standingsRespuestaCall.enqueue(new Callback&lt;StandingsRespuesta&gt;() {
              @Override
              public void onResponse(Call&lt;StandingsRespuesta&gt; call, Response&lt;StandingsRespuesta&gt; response) {
                  if(response.isSuccessful()) {
                      StandingsRespuesta standingsRespuesta = response.body();
                      List&lt;Stand&gt; listaStands = standingsRespuesta.getStandings();
                      listaPartidosAdapter.adicionarListaStands((ArrayList&lt;Stand&gt;) listaStands);
                  }
              }
              @Override
              public void onFailure(Call&lt;StandingsRespuesta&gt; call, Throwable t) {
  
              }
          });
      }
  
  }
  </code></pre>