catch exceptions thrown at trying to show the image on a map

This commit is contained in:
tibbi 2018-02-05 09:59:18 +01:00
parent ed99b03f8a
commit 8d7853e4f0

View file

@ -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)