Skip to content

Commit 1960262

Browse files
committed
Merge branch 'dev'
2 parents c227062 + 8edebb9 commit 1960262

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Wox/ViewModel/ResultViewModel.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Windows.Media;
33
using System.Windows.Threading;
4+
using Wox.Infrastructure;
45
using Wox.Infrastructure.Image;
56
using Wox.Infrastructure.Logger;
67
using Wox.Plugin;
@@ -22,7 +23,8 @@ public ImageSource Image
2223
{
2324
get
2425
{
25-
if (string.IsNullOrEmpty(Result.IcoPath))
26+
var imagePath = Result.IcoPath;
27+
if (string.IsNullOrEmpty(imagePath) && Result.Icon != null)
2628
{
2729
try
2830
{
@@ -31,13 +33,12 @@ public ImageSource Image
3133
catch (Exception e)
3234
{
3335
Log.Exception($"|ResultViewModel.Image|IcoPath is empty and exception when calling Icon() for result <{Result.Title}> of plugin <{Result.PluginDirectory}>", e);
34-
return ImageLoader.Load(Result.IcoPath);
36+
imagePath = Constant.ErrorIcon;
3537
}
3638
}
37-
else
38-
{
39-
return ImageLoader.Load(Result.IcoPath);
40-
}
39+
40+
// will get here either when icoPath has value\icon delegate is null\when had exception in delegate
41+
return ImageLoader.Load(imagePath);
4142
}
4243
}
4344

0 commit comments

Comments
 (0)