1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-22 14:47:29 +00:00

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

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