Prevent crash on pause for Media Preview with no fragments.

This commit is contained in:
Nicholas Tinsley 2022-12-23 12:20:56 -05:00
parent 9846517075
commit 3f160f256a

View file

@ -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
}