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 ab5e68d4a..bbb3c515b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -581,12 +581,17 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View @TargetApi(Build.VERSION_CODES.N) private fun tryRotateByExif(path: String): Boolean { - return if (saveImageRotation(path, mRotationDegrees)) { - mRotationDegrees = 0 - invalidateOptionsMenu() - toast(R.string.file_saved) - true - } else { + return try { + if (saveImageRotation(path, mRotationDegrees)) { + mRotationDegrees = 0 + invalidateOptionsMenu() + toast(R.string.file_saved) + true + } else { + false + } + } catch (e: Exception) { + showErrorToast(e) false } }