From 8e8f23e6d1cdf307bee209a06fb6ac4c02f4e3bf Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 2 Dec 2019 10:22:55 +0100 Subject: [PATCH] catch exceptions at fetching photo gps coordinates --- .../gallery/pro/fragments/ViewPagerFragment.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 471c11635..3c95c9927 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 @@ -102,7 +102,12 @@ abstract class ViewPagerFragment : Fragment() { private fun getLatLonAltitude(path: String): String { var result = "" - val exif = ExifInterface(path) + val exif = try { + ExifInterface(path) + } catch (e: Exception) { + return "" + } + val latLon = FloatArray(2) if (exif.getLatLong(latLon)) {