Skip to content

Commit

Permalink
Prevent crash on pause for Media Preview with no fragments.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholas-signal committed Dec 23, 2022
1 parent 9846517 commit 3f160f2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MediaPreviewV2Adapter(fragment: Fragment) : FragmentStateAdapter(fragment)
}

fun getFragmentTag(position: Int): String? {
if (position < 0 || position > itemCount) {
if (items.isEmpty() || position < 0 || position > itemCount) {
return null
}

Expand Down

0 comments on commit 3f160f2

Please sign in to comment.