Skip to content

Commit

Permalink
Pushed null-check into icon extraction function.
Browse files Browse the repository at this point in the history
  • Loading branch information
AtlasHackert committed Aug 28, 2017
1 parent 8340d85 commit 3ef1aa7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Common/Helpers/FirewallHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ public ImageSource Icon
{
if (_icon == null)
{
//Some apps (Ahem, IE) may create a rule where the ApplicationName is null. Supplement an empty string in case.
_icon = IconHelper.GetIcon(this.ApplicationName == null ? "" : this.ApplicationName); //FIXME: This is now expanded... Is that a problem?!?
_icon = IconHelper.GetIcon(this.ApplicationName); //FIXME: This is now expanded... Is that a problem?!?
}

return _icon;
Expand Down
4 changes: 4 additions & 0 deletions Common/Helpers/IconHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public class IconHelper
private static BitmapSource GetIconFromPath(string path, bool defaultIfNotFound = false)
{
Icon ic = null;
if (String.IsNullOrEmpty(path))
{
path = "?error";
}
switch (path)
{
case "System":
Expand Down

0 comments on commit 3ef1aa7

Please sign in to comment.