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

This commit is contained in:
Ammar Githam 2020-11-19 01:36:30 +09:00
parent f01815f4ae
commit e3cc99f62f
1 changed files with 1 additions and 1 deletions

View File

@ -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();