This commit is contained in:
Horis
2025-12-21 11:06:08 +08:00
parent e8d876b642
commit 5370e3bfd3
@@ -182,7 +182,7 @@ class ImportBookActivity : BaseImportBookActivity<ImportBookViewModel>(),
private fun initRootPath(rootUri: Uri) { private fun initRootPath(rootUri: Uri) {
kotlin.runCatching { kotlin.runCatching {
val doc = DocumentFile.fromTreeUri(this, rootUri) val doc = DocumentFile.fromTreeUri(this, rootUri)
if (doc == null || doc.name.isNullOrEmpty()) { if (doc == null || doc.name.isNullOrEmpty() || !doc.isDirectory) {
binding.tvEmptyMsg.visible() binding.tvEmptyMsg.visible()
selectFolder.launch() selectFolder.launch()
} else { } else {