From 255c3c84b444481410ba99885ea2d32a57478ad6 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Wed, 13 Jan 2021 11:24:23 -0500 Subject: [PATCH] once again fix null guards in feed --- .../main/java/awais/instagrabber/webservices/FeedService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/awais/instagrabber/webservices/FeedService.java b/app/src/main/java/awais/instagrabber/webservices/FeedService.java index 72e75adc..2bd91690 100644 --- a/app/src/main/java/awais/instagrabber/webservices/FeedService.java +++ b/app/src/main/java/awais/instagrabber/webservices/FeedService.java @@ -109,7 +109,6 @@ public class FeedService extends BaseService { final List allPosts = new ArrayList<>(); final List items = feedFetchResponse.getItems(); for (final Media media : items) { - if (media == null || media.isInjected() || (media.getMediaType() == null && media.getEndOfFeedDemarcator() == null)) continue; if (needNewMaxId && media.getEndOfFeedDemarcator() != null) { final EndOfFeedDemarcator endOfFeedDemarcator = media.getEndOfFeedDemarcator(); final EndOfFeedGroupSet groupSet = endOfFeedDemarcator.getGroupSet(); @@ -128,6 +127,7 @@ public class FeedService extends BaseService { } continue; } + if (media == null || media.isInjected() || media.getMediaType() == null) continue; allPosts.add(media); } return new PostsFetchResponse(allPosts, moreAvailable, nextMaxId);