From 35de514ee31a4632f02cfc8ba990785b6feb7135 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 10 Nov 2019 10:17:37 +0100 Subject: [PATCH] adding a null check at fetching photo path --- app/build.gradle | 2 +- .../gallery/pro/fragments/ViewPagerFragment.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 01dddf17f..6691c53ba 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.19.10' + implementation 'com.simplemobiletools:commons:5.19.12' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/ViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/ViewPagerFragment.kt index fd350941c..471c11635 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/ViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/ViewPagerFragment.kt @@ -81,7 +81,7 @@ abstract class ViewPagerFragment : Fragment() { return details.toString().trim() } - fun getPathToLoad(medium: Medium) = if (context!!.isPathOnOTG(medium.path)) medium.path.getOTGPublicPath(context!!) else medium.path + fun getPathToLoad(medium: Medium) = if (context?.isPathOnOTG(medium.path) == true) medium.path.getOTGPublicPath(context!!) else medium.path private fun getFileLastModified(file: File): String { val projection = arrayOf(MediaStore.Images.Media.DATE_MODIFIED)