From 9452d96e755da8de6358bf6e1b2f1156817a5002 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Jun 2017 21:39:19 +0200 Subject: [PATCH] catch FileNotFoundException at returning GetImageContent intent result --- .../simplemobiletools/gallery/activities/MainActivity.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 8e5c99539..87d2d269f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -27,10 +27,7 @@ import com.simplemobiletools.gallery.helpers.* import com.simplemobiletools.gallery.models.Directory import com.simplemobiletools.gallery.views.MyScalableRecyclerView import kotlinx.android.synthetic.main.activity_main.* -import java.io.File -import java.io.FileInputStream -import java.io.InputStream -import java.io.OutputStream +import java.io.* import java.util.* class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { @@ -302,6 +299,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { inputStream = FileInputStream(File(path)) outputStream = contentResolver.openOutputStream(output) inputStream.copyTo(outputStream) + } catch (ignored: FileNotFoundException) { } finally { inputStream?.close() outputStream?.close()