Browse Source

Check highlight list before accessing. Fixes https://github.com/austinhuang0131/barinsta/issues/295

renovate/org.robolectric-robolectric-4.x
Ammar Githam 4 years ago
parent
commit
e3cc99f62f
  1. 2
      app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java

2
app/src/main/java/awais/instagrabber/fragments/StoryViewerFragment.java

@ -484,7 +484,7 @@ public class StoryViewerFragment extends Fragment {
if (isHighlight) {
final HighlightsViewModel highlightsViewModel = (HighlightsViewModel) viewModel;
final List<HighlightModel> models = highlightsViewModel.getList().getValue();
if (models == null) return;
if (models == null || models.isEmpty() || currentFeedStoryIndex >= models.size()) return;
final HighlightModel model = models.get(currentFeedStoryIndex);
currentStoryMediaId = model.getId();
currentStoryUsername = model.getTitle();

Loading…
Cancel
Save