From 19516afb8339273aeab4e9d1bb524e53972d461d Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Sun, 21 Mar 2021 21:49:59 -0400 Subject: [PATCH] close #834? --- .../awais/instagrabber/webservices/NewsService.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/webservices/NewsService.java b/app/src/main/java/awais/instagrabber/webservices/NewsService.java index 6a51d8f1..fe54c13d 100644 --- a/app/src/main/java/awais/instagrabber/webservices/NewsService.java +++ b/app/src/main/java/awais/instagrabber/webservices/NewsService.java @@ -121,9 +121,15 @@ public class NewsService extends BaseService { callback.onSuccess(null); return; } - final List aymlUsers = new ArrayList<>(); - aymlUsers.addAll(body.getNewSuggestedUsers().getSuggestions()); - aymlUsers.addAll(body.getSuggestedUsers().getSuggestions()); + final List aymlUsers = new ArrayList(); + final List newSuggestions = body.getNewSuggestedUsers().getSuggestions(); + if (newSuggestions != null) { + aymlUsers.addAll(newSuggestions); + } + final List oldSuggestions = body.getSuggestedUsers().getSuggestions(); + if (oldSuggestions != null) { + aymlUsers.addAll(oldSuggestions); + } final List newsItems = aymlUsers.stream() .map(i -> {