diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java index 95ee30d7b..c75f3367f 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java @@ -337,6 +337,8 @@ public class ViewPagerActivity extends AppCompatActivity } private Medium getCurrentMedium() { + if (pos >= media.size()) + pos = media.size() - 1; return media.get(pos); }