From 58c2c84120cc84ef6202a003e949c05dac328dd1 Mon Sep 17 00:00:00 2001 From: Martin Meixger Date: Wed, 10 Aug 2016 14:33:58 +0200 Subject: [PATCH] Fixes issue #846 IndexOutOfRangeException when reading empty icon from registry in ControlPanel plugin --- Plugins/Wox.Plugin.ControlPanel/ControlPanelList.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Plugins/Wox.Plugin.ControlPanel/ControlPanelList.cs b/Plugins/Wox.Plugin.ControlPanel/ControlPanelList.cs index 7b664f1fc7..49c4b3831f 100644 --- a/Plugins/Wox.Plugin.ControlPanel/ControlPanelList.cs +++ b/Plugins/Wox.Plugin.ControlPanel/ControlPanelList.cs @@ -230,6 +230,12 @@ namespace Wox.Plugin.ControlPanel if (currentKey.OpenSubKey("DefaultIcon").GetValue(null) != null) { iconString = new List(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);