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? {
|
||||
return if (mMedia.isEmpty())
|
||||
return if (mMedia.isEmpty() || mPos >= mMedia.size)
|
||||
null
|
||||
else
|
||||
mMedia[Math.min(mPos, mMedia.size - 1)]
|
||||
|
|
Loading…
Reference in a new issue