Fix index out of bounds error

This commit is contained in:
Travis Nickles 2017-05-20 18:56:11 -07:00
parent 59d30bcf3a
commit aa0e0fce50

View File

@ -1105,12 +1105,13 @@ namespace DS4Windows
new DS4Color(Color.Black), new DS4Color(Color.Black),
new DS4Color(Color.Black) new DS4Color(Color.Black)
}; };
public bool[] useCustomLeds = new bool[] { false, false, false, false }; public bool[] useCustomLeds = new bool[] { false, false, false, false, false };
public DS4Color[] m_CustomLeds = new DS4Color[] public DS4Color[] m_CustomLeds = new DS4Color[]
{ {
new DS4Color(Color.Black), new DS4Color(Color.Black),
new DS4Color(Color.Black), new DS4Color(Color.Black),
new DS4Color(Color.Black), new DS4Color(Color.Black),
new DS4Color(Color.Black),
new DS4Color(Color.Black) new DS4Color(Color.Black)
}; };
public int[] chargingType = { 0, 0, 0, 0, 0 }; public int[] chargingType = { 0, 0, 0, 0, 0 };
@ -2697,7 +2698,7 @@ namespace DS4Windows
bool.TryParse(ss[0], out useCustomLeds[i]); bool.TryParse(ss[0], out useCustomLeds[i]);
DS4Color.TryParse(ss[1], ref m_CustomLeds[i]); DS4Color.TryParse(ss[1], ref m_CustomLeds[i]);
} }
catch { missingSetting = true; } catch { useCustomLeds[i] = false; m_CustomLeds[i] = new DS4Color(Color.Black); missingSetting = true; }
} }
} }
} }