From 0bb1669efadd4f05220d44e20f9bcd552fef9143 Mon Sep 17 00:00:00 2001 From: Chin allan Date: Thu, 8 Jan 2015 08:47:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20GetIcon=20=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E5=87=BA=E7=8E=B0=E7=9A=84=20FileNotFoundException=20?= =?UTF-8?q?=20=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重启电脑的时候会提示 FileNotFoundException ,所以在这里加一个检查。 --- Wox/ImageLoader/ImageLoader.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Wox/ImageLoader/ImageLoader.cs b/Wox/ImageLoader/ImageLoader.cs index 5eccebb2b0..eb9d002665 100644 --- a/Wox/ImageLoader/ImageLoader.cs +++ b/Wox/ImageLoader/ImageLoader.cs @@ -38,6 +38,11 @@ namespace Wox.ImageLoader private static ImageSource GetIcon(string fileName) { + if (System.IO.File.Exists(fileName) == false) + { + return null; + } + Icon icon = GetFileIcon(fileName); if (icon == null) icon = Icon.ExtractAssociatedIcon(fileName);