From 5a6771e491d2b6e7566071c3a96dc8828979639f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=9D=E9=9B=B6?= <78294929+JiuLing-zhang@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:28:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E6=98=BE=E5=BC=8F?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E5=9B=BE=E6=A0=87=E8=B7=AF=E5=BE=84=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=97=B6=E4=BD=BF=E7=94=A8=E9=BB=98=E8=AE=A4=E5=9B=BE?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Creator/UpgradeSettingBuilder.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/JiuLing.AutoUpgrade.Shell/Creator/UpgradeSettingBuilder.cs b/src/JiuLing.AutoUpgrade.Shell/Creator/UpgradeSettingBuilder.cs index 9386d3e..2790681 100644 --- a/src/JiuLing.AutoUpgrade.Shell/Creator/UpgradeSettingBuilder.cs +++ b/src/JiuLing.AutoUpgrade.Shell/Creator/UpgradeSettingBuilder.cs @@ -81,11 +81,14 @@ public UpgradeSettingBuilder WithLang(string lang) /// public UpgradeSettingBuilder WithIcon(string path) { - if (!File.Exists(path)) + if (!string.IsNullOrEmpty(path)) { - throw new FileNotFoundException($"图标文件不存在: {path}"); + if (!File.Exists(path)) + { + throw new FileNotFoundException($"图标文件不存在: {path}"); + } + _upgradeSetting.IconPath = path; } - _upgradeSetting.IconPath = path; return this; }