diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt index b8d71b515..4b56b9aff 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt @@ -333,7 +333,10 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack { val bgName = FileUtils.getName(config.bgStr()) val bgPath = FileUtils.getPath(requireContext().externalFilesDir, "bg", bgName) if (!FileUtils.exist(bgPath)) { - FileUtils.getFile(configDir, bgName).copyTo(File(bgPath)) + val bgFile = FileUtils.getFile(configDir, bgName) + if (bgFile.exists()) { + bgFile.copyTo(File(bgPath)) + } } } ReadBookConfig.durConfig = config