Fix IndexOutOfBoundsException when rapidly tapping through stories.

This commit is contained in:
Alex Hart
2022-10-11 12:43:22 -03:00
committed by Greyson Parrelli
parent 83d1ab2eb5
commit 7315c991d5

View File

@@ -130,7 +130,8 @@ object StoryContextMenu {
onInfo: (StoryPost) -> Unit,
onDismiss: () -> Unit
) {
val selectedStory: StoryPost = storyViewerPageState.posts[storyViewerPageState.selectedPostIndex]
val selectedStory: StoryPost = storyViewerPageState.posts.getOrNull(storyViewerPageState.selectedPostIndex) ?: return
show(
context = context,
anchorView = anchorView,