Fixes issue #846 IndexOutOfRangeException when reading empty icon from registry in ControlPanel plugin

This commit is contained in:
Martin Meixger 2016-08-10 14:33:58 +02:00
parent a96947c7e7
commit 58c2c84120

View File

@ -230,6 +230,12 @@ namespace Wox.Plugin.ControlPanel
if (currentKey.OpenSubKey("DefaultIcon").GetValue(null) != null)
{
iconString = new List<string>(currentKey.OpenSubKey("DefaultIcon").GetValue(null).ToString().Split(new[] { ',' }, 2));
if (string.IsNullOrEmpty(iconString[0]))
{
// fallback to default icon
return null;
}
if (iconString[0][0] == '@')
{
iconString[0] = iconString[0].Substring(1);