From 188e2f125480bec6601b3395ceb50fd226b2b0c4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 7 Sep 2017 21:34:44 +0200 Subject: [PATCH] catch exceptions thrown at ViewPagerActivity --- .../gallery/activities/ViewPagerActivity.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 6318293ae..fb809047b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -91,8 +91,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View cursor?.close() } } else { - mPath = intent.getStringExtra(MEDIUM) - mShowAll = config.showAll + try { + mPath = intent.getStringExtra(MEDIUM) + mShowAll = config.showAll + } catch (e: Exception) { + showErrorToast(e) + finish() + return + } } if (mPath.isEmpty()) {