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 64b5e02e6..0d1033a2f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -644,7 +644,13 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun showOnMap() { - val exif = ExifInterface(getCurrentPath()) + val exif: ExifInterface + try { + exif = ExifInterface(getCurrentPath()) + } catch (e: Exception) { + showErrorToast(e) + return + } val lat = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE) val lat_ref = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF) val lon = exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE)