diff --git a/GK6X/KeyboardState.cs b/GK6X/KeyboardState.cs index 16295dc..a124d75 100644 --- a/GK6X/KeyboardState.cs +++ b/GK6X/KeyboardState.cs @@ -197,7 +197,7 @@ private void SetupDriverKeySetBuffer(Dictionary 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))