Browse Source

once again fix null guards in feed

renovate/org.robolectric-robolectric-4.x
Austin Huang 4 years ago
parent
commit
255c3c84b4
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 2
      app/src/main/java/awais/instagrabber/webservices/FeedService.java

2
app/src/main/java/awais/instagrabber/webservices/FeedService.java

@ -109,7 +109,6 @@ public class FeedService extends BaseService {
final List<Media> allPosts = new ArrayList<>();
final List<Media> 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);

Loading…
Cancel
Save