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)