diff --git a/app/src/main/java/com/example/android/audacity/adapters/ChallengesAdapter.java b/app/src/main/java/com/example/android/audacity/adapters/ChallengesAdapter.java index 8d92e92..f0692da 100644 --- a/app/src/main/java/com/example/android/audacity/adapters/ChallengesAdapter.java +++ b/app/src/main/java/com/example/android/audacity/adapters/ChallengesAdapter.java @@ -51,7 +51,7 @@ public void onBindViewHolder(@NonNull ViewHolder holder, int position) { @Override public int getItemCount() { - return mChallengeData.size(); + return mChallengeData == null ? 0 : mChallengeData.size(); } public class ViewHolder extends RecyclerView.ViewHolder { diff --git a/app/src/main/java/com/example/android/audacity/adapters/HottestAppAdapter.java b/app/src/main/java/com/example/android/audacity/adapters/HottestAppAdapter.java index c2254b3..f72592d 100644 --- a/app/src/main/java/com/example/android/audacity/adapters/HottestAppAdapter.java +++ b/app/src/main/java/com/example/android/audacity/adapters/HottestAppAdapter.java @@ -51,7 +51,7 @@ public void onBindViewHolder(@NonNull ViewHolder holder, int position) { @Override public int getItemCount() { - return mHottestAppData.size(); + return mHottestAppData == null ? 0 : mHottestAppData.size(); } public class ViewHolder extends RecyclerView.ViewHolder {