diff --git a/app/src/main/java/io/legado/app/ui/font/FontAdapter.kt b/app/src/main/java/io/legado/app/ui/font/FontAdapter.kt index b41249019..a7f68d41c 100644 --- a/app/src/main/java/io/legado/app/ui/font/FontAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/font/FontAdapter.kt @@ -15,8 +15,9 @@ import java.net.URLDecoder class FontAdapter(context: Context, curFilePath: String, val callBack: CallBack) : RecyclerAdapter(context) { - private val curName = URLDecoder.decode(curFilePath, "utf-8") - .substringAfterLast(File.separator) + private val curName = kotlin.runCatching { + URLDecoder.decode(curFilePath, "utf-8") + }.getOrNull()?.substringAfterLast(File.separator) override fun getViewBinding(parent: ViewGroup): ItemFontBinding { return ItemFontBinding.inflate(inflater, parent, false)