catch exceptions thrown at saving image rotation

This commit is contained in:
tibbi 2018-04-14 22:11:33 +02:00
parent d8c17b8a80
commit 6db0adced8

View file

@ -581,7 +581,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
@TargetApi(Build.VERSION_CODES.N)
private fun tryRotateByExif(path: String): Boolean {
return if (saveImageRotation(path, mRotationDegrees)) {
return try {
if (saveImageRotation(path, mRotationDegrees)) {
mRotationDegrees = 0
invalidateOptionsMenu()
toast(R.string.file_saved)
@ -589,6 +590,10 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
} else {
false
}
} catch (e: Exception) {
showErrorToast(e)
false
}
}
private fun copyFile(source: File, destination: File) {