From f269b8e6a3d2da810a553fc93a8078704f3d57e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=93=9D=E7=82=B9lilac?= Date: Tue, 22 Dec 2020 20:09:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E6=A0=87Icon=E9=94=AE=E5=80=BC?= =?UTF-8?q?=E7=A9=BA=E5=BC=82=E5=B8=B8=E8=A7=A3=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ContextMenuManager/Controls/ShellItem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ContextMenuManager/Controls/ShellItem.cs b/ContextMenuManager/Controls/ShellItem.cs index c7fc8cf..cfb5101 100644 --- a/ContextMenuManager/Controls/ShellItem.cs +++ b/ContextMenuManager/Controls/ShellItem.cs @@ -129,7 +129,7 @@ namespace ContextMenuManager.Controls MessageBoxButtons.YesNo) != DialogResult.Yes; public string ItemFilePath => GuidInfo.GetFilePath(Guid) ?? ObjectPath.ExtractFilePath(ItemCommand); - private bool HasIcon => IconLocation != null || HasLUAShield; + private bool HasIcon => !IconLocation.IsNullOrWhiteSpace() || HasLUAShield; private bool OnlyInExplorer { @@ -330,7 +330,7 @@ namespace ContextMenuManager.Controls if(IconLocation != null) { icon = ResourceIcon.GetIcon(IconLocation, out iconPath, out iconIndex); - if(icon == null && Path.GetExtension(iconPath).ToLower() == ".exe") + if(icon == null && Path.GetExtension(iconPath)?.ToLower() == ".exe") icon = ResourceIcon.GetIcon(iconPath = "imageres.dll", iconIndex = -15);//文件为不存在的或没有图标的exe文件,不含图标的默认exe图标 } else if(HasLUAShield)