From 0fb04f1547331e74d9a6646f9b601286d57a926c Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 4 May 2021 13:11:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/document/FilePickerActivity.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/document/FilePickerActivity.kt b/app/src/main/java/io/legado/app/ui/document/FilePickerActivity.kt index c3f601271..17a11d799 100644 --- a/app/src/main/java/io/legado/app/ui/document/FilePickerActivity.kt +++ b/app/src/main/java/io/legado/app/ui/document/FilePickerActivity.kt @@ -23,6 +23,7 @@ class FilePickerActivity : private val selectDocTree = registerForActivityResult(ActivityResultContracts.OpenDocumentTree()) { + it ?: return@registerForActivityResult if (it.isContentScheme()) { contentResolver.takePersistableUriPermission( it, @@ -33,6 +34,7 @@ class FilePickerActivity : } private val selectDoc = registerForActivityResult(ActivityResultContracts.OpenDocument()) { + it ?: return@registerForActivityResult onResult(Intent().setData(it)) }