Skip to content

Commit 73cb5fd

Browse files
committed
fix(android): cpExternal prematurely closes output stream
Fixes #5
1 parent fc1dc47 commit 73cb5fd

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

android/src/main/java/com/alpha0010/FileAccessModule.kt

+5-7
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,11 @@ class FileAccessModule(reactContext: ReactApplicationContext) : ReactContextBase
121121
else -> null
122122
}?.let { reactApplicationContext.contentResolver.openOutputStream(it) }
123123
}?.use { output ->
124-
ioScope.launch {
125-
try {
126-
input.copyTo(output)
127-
promise.resolve(null)
128-
} catch (e: Throwable) {
129-
promise.reject(e)
130-
}
124+
try {
125+
input.copyTo(output)
126+
promise.resolve(null)
127+
} catch (e: Throwable) {
128+
promise.reject(e)
131129
}
132130
return
133131
}

0 commit comments

Comments
 (0)