From 3001ea4a235d341d792f16277d0a89e3bbfb6cb5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 3 Jun 2017 08:37:52 +0200 Subject: [PATCH] adding a crashfix at updating actionbar title --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 4862f84f3..d92ed325a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -502,7 +502,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun updateActionbarTitle() { runOnUiThread { - title = mMedia[mPos].path.getFilenameFromPath() + if (mPos < mMedia.size) { + title = mMedia[mPos].path.getFilenameFromPath() + } } }