mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 11:39:16 +08:00
Fixes issue #846 IndexOutOfRangeException when reading empty icon from registry in ControlPanel plugin
This commit is contained in:
parent
a96947c7e7
commit
58c2c84120
@ -230,6 +230,12 @@ namespace Wox.Plugin.ControlPanel
|
|||||||
if (currentKey.OpenSubKey("DefaultIcon").GetValue(null) != null)
|
if (currentKey.OpenSubKey("DefaultIcon").GetValue(null) != null)
|
||||||
{
|
{
|
||||||
iconString = new List<string>(currentKey.OpenSubKey("DefaultIcon").GetValue(null).ToString().Split(new[] { ',' }, 2));
|
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] == '@')
|
if (iconString[0][0] == '@')
|
||||||
{
|
{
|
||||||
iconString[0] = iconString[0].Substring(1);
|
iconString[0] = iconString[0].Substring(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user