Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/Plugin.Iconize/Iconize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,10 @@ public static IIconModule FindModuleOf(IIcon icon)
/// <returns>The icon, or null if no icon matches the key</returns>
public static IIcon FindIconForKey(String iconKey)
{
if (iconKey is null)
throw new ArgumentNullException(nameof(iconKey));

if (String.IsNullOrWhiteSpace(iconKey))
throw new ArgumentException($"{nameof(iconKey)} cannot be empty", nameof(iconKey));
return null;

return Modules?.FirstOrDefault(x => x.Keys.Contains(iconKey))?.GetIcon(iconKey) ?? throw new NullReferenceException($"No icon with the key: {iconKey}");
return Modules?.FirstOrDefault(x => x.Keys.Contains(iconKey))?.GetIcon(iconKey);
}
}
}