From e9ad7fc3aa1f81bbc4ee363fe42833b4024f7c95 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 13 Oct 2020 17:19:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0android=20studio=20=E5=88=B0?= =?UTF-8?q?=204.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/config/BgTextConfigDialog.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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