|
|
@@ -436,8 +436,8 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
|
|
|
FileInputStream(image).use { input ->
|
|
|
if (uri.isContentScheme()) {
|
|
|
DocumentFile.fromTreeUri(context, uri)?.let { doc ->
|
|
|
- DocumentUtils.createFileIfNotExist(doc, image.name)
|
|
|
- context.contentResolver.openOutputStream(doc.uri)!!.use { output ->
|
|
|
+ val imageDoc = DocumentUtils.createFileIfNotExist(doc, image.name)!!
|
|
|
+ context.contentResolver.openOutputStream(imageDoc.uri)!!.use { output ->
|
|
|
input.copyTo(output)
|
|
|
}
|
|
|
}
|