mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-27 09:17:47 +01:00
add another check at getting current media of viewpager
This commit is contained in:
parent
0e38255961
commit
f4ddc12911
@ -498,7 +498,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||
}
|
||||
|
||||
private fun getCurrentMedium(): Medium? {
|
||||
return if (mMedia.isEmpty())
|
||||
return if (mMedia.isEmpty() || mPos >= mMedia.size)
|
||||
null
|
||||
else
|
||||
mMedia[Math.min(mPos, mMedia.size - 1)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user