diff --git a/app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt b/app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt index e3162860c..be5523b58 100644 --- a/app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt +++ b/app/src/main/java/io/legado/app/ui/widget/font/FontSelectDialog.kt @@ -71,11 +71,15 @@ class FontSelectDialog : BaseDialogFragment(), if (fontPath.isNullOrEmpty()) { openFolder() } else { - val doc = DocumentFile.fromTreeUri(requireContext(), Uri.parse(fontPath)) - if (doc?.canRead() == true) { - getFontFiles(doc) + if (fontPath.isContentPath()) { + val doc = DocumentFile.fromTreeUri(requireContext(), Uri.parse(fontPath)) + if (doc?.canRead() == true) { + getFontFiles(doc) + } else { + openFolder() + } } else { - openFolder() + getFontFilesByPermission(fontPath) } } }