From de557ff61876c9cc72410ed1c3347a8124804241 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 5 Mar 2021 21:02:43 +0100 Subject: [PATCH] moving outputstream creating to try/catch block --- .../voicerecorder/services/RecorderService.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/services/RecorderService.kt b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/services/RecorderService.kt index 76d147b..b9a2b60 100644 --- a/app/src/main/kotlin/com/simplemobiletools/voicerecorder/services/RecorderService.kt +++ b/app/src/main/kotlin/com/simplemobiletools/voicerecorder/services/RecorderService.kt @@ -180,10 +180,8 @@ class RecorderService : Service() { return } - val outputStream = contentResolver.openOutputStream(newUri) - - try { + val outputStream = contentResolver.openOutputStream(newUri) val inputStream = getFileInputStreamSync(currFilePath) inputStream!!.copyTo(outputStream!!, DEFAULT_BUFFER_SIZE) recordingSavedSuccessfully(true)