From 1567ca05fb55c4837bbbd9c7e6403387b0578969 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 30 Jul 2018 12:31:54 +0200 Subject: [PATCH] add a null check at getting current path --- .../simplemobiletools/gallery/activities/ViewPagerActivity.kt | 2 +- 1 file changed, 1 insertion(+), 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 2a0dba669..6a88aec32 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -1104,7 +1104,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun getCurrentMedia() = if (mAreSlideShowMediaVisible) mSlideshowMedia else mMediaFiles - private fun getCurrentPath() = getCurrentMedium()!!.path + private fun getCurrentPath() = getCurrentMedium()?.path ?: "" private fun getCurrentFile() = File(getCurrentPath())