mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
add another check at getting current media of viewpager
This commit is contained in:
parent
0e38255961
commit
f4ddc12911
1 changed files with 1 additions and 1 deletions
|
@ -498,7 +498,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getCurrentMedium(): Medium? {
|
private fun getCurrentMedium(): Medium? {
|
||||||
return if (mMedia.isEmpty())
|
return if (mMedia.isEmpty() || mPos >= mMedia.size)
|
||||||
null
|
null
|
||||||
else
|
else
|
||||||
mMedia[Math.min(mPos, mMedia.size - 1)]
|
mMedia[Math.min(mPos, mMedia.size - 1)]
|
||||||
|
|
Loading…
Reference in a new issue