Skip to content

Commit

Permalink
Possibly fix #152
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeltris committed Jun 18, 2021
1 parent 2f7f388 commit 0489a02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GK6X/KeyboardState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private void SetupDriverKeySetBuffer(Dictionary<string, object> modelData, strin
long index;
long driverValue;
string driverValueStr;
if (Json.TryGetValue(keySet, "Index", out index) &&
if (Json.TryGetValue(keySet, "Index", out index) && index < driverKeySetArray.Length &&
Json.TryGetValue(keySet, "DriverValue", out driverValueStr) &&
driverValueStr.StartsWith("0x") &&
long.TryParse(driverValueStr.Substring(2), NumberStyles.HexNumber, null, out driverValue))
Expand Down

0 comments on commit 0489a02

Please sign in to comment.