Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
jjw24 committed Nov 11, 2019
2 parents c227062 + 8edebb9 commit 1960262
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Wox/ViewModel/ResultViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Windows.Media;
using System.Windows.Threading;
using Wox.Infrastructure;
using Wox.Infrastructure.Image;
using Wox.Infrastructure.Logger;
using Wox.Plugin;
Expand All @@ -22,7 +23,8 @@ public ImageSource Image
{
get
{
if (string.IsNullOrEmpty(Result.IcoPath))
var imagePath = Result.IcoPath;
if (string.IsNullOrEmpty(imagePath) && Result.Icon != null)
{
try
{
Expand All @@ -31,13 +33,12 @@ public ImageSource Image
catch (Exception e)
{
Log.Exception($"|ResultViewModel.Image|IcoPath is empty and exception when calling Icon() for result <{Result.Title}> of plugin <{Result.PluginDirectory}>", e);
return ImageLoader.Load(Result.IcoPath);
imagePath = Constant.ErrorIcon;
}
}
else
{
return ImageLoader.Load(Result.IcoPath);
}

// will get here either when icoPath has value\icon delegate is null\when had exception in delegate
return ImageLoader.Load(imagePath);
}
}

Expand Down

0 comments on commit 1960262

Please sign in to comment.