From afd1a822599fd9f1ee02dc7f0307b26ae88cf822 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 29 Aug 2021 21:52:12 +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 --- .../java/io/legado/app/ui/document/HandleFileContract.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/document/HandleFileContract.kt b/app/src/main/java/io/legado/app/ui/document/HandleFileContract.kt index ef4c4d4eb..1571ec882 100644 --- a/app/src/main/java/io/legado/app/ui/document/HandleFileContract.kt +++ b/app/src/main/java/io/legado/app/ui/document/HandleFileContract.kt @@ -15,10 +15,12 @@ class HandleFileContract : const val FILE = 1 } - override fun createIntent(context: Context, input: HandleFileParam.() -> Unit): Intent { + override fun createIntent(context: Context, input: (HandleFileParam.() -> Unit)?): Intent { val intent = Intent(context, HandleFileActivity::class.java) val handleFileParam = HandleFileParam() - handleFileParam.apply(input) + input?.let { + handleFileParam.apply(input) + } handleFileParam.let { intent.putExtra("mode", it.mode) intent.putExtra("title", it.title)