From 91b2cc40e112d98ac4dbee2581fbfdb9e3c3628e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 1 Jul 2018 11:58:00 +0200 Subject: [PATCH] add a null check at deleting medium --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 4 ++++ 1 file changed, 4 insertions(+) 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 dab05977d..ab0899e18 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -908,6 +908,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun checkDeleteConfirmation() { + if (getCurrentMedium() == null) { + return + } + if (config.tempSkipDeleteConfirmation || config.skipDeleteConfirmation) { deleteConfirmed() } else {