Check to see if the key is in the dictionary before continuing

This commit is contained in:
Michael Becker 2015-04-27 08:54:19 -04:00
parent 611776a2d5
commit c31414d5af

View File

@ -237,6 +237,7 @@ internal static class IconMethods
public static void PopulateSystemIcons(ref System.Windows.Forms.ImageList iml)
{
InitializeSystemIcons();
string[] paths = new string[]
{
"generic-file",
@ -251,7 +252,7 @@ internal static class IconMethods
string path = "ImageList/" + iml.ImageSize.Width.ToString() + "x" + iml.ImageSize.Height.ToString() + "/" + s + ".png";
Image image = AwesomeControls.Theming.Theme.CurrentTheme.GetImage(path);
if (image == null) image = _systemIcons[s + "-16x16"];
if (image == null && _systemIcons.ContainsKey(s + "-16x16")) image = _systemIcons[s + "-16x16"];
if (image != null)
{
// the image exists, so use it