From 45844439dd7d38151e4e5e702123ed7371e2fb03 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 5 Jun 2022 22:55:04 +0200 Subject: [PATCH] catch and show exceptions thrown at cropping third party intents --- .../simplemobiletools/gallery/pro/activities/EditActivity.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt index 46a9853d9..986bf6870 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/EditActivity.kt @@ -794,6 +794,9 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener inputStream = ByteArrayInputStream(stream.toByteArray()) outputStream = contentResolver.openOutputStream(saveUri) inputStream.copyTo(outputStream!!) + } catch (e: Exception) { + showErrorToast(e) + return } finally { inputStream?.close() outputStream?.close()