Prevent crash on pause for Media Preview with no fragments.

main
Nicholas Tinsley 2022-12-23 12:20:56 -05:00
rodzic 9846517075
commit 3f160f256a
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

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