From 0489a02c5ae1a207ff880e06675a48e83b40a3da Mon Sep 17 00:00:00 2001 From: pixeltris <6952411+pixeltris@users.noreply.github.com> Date: Fri, 18 Jun 2021 23:42:38 +0100 Subject: [PATCH] Possibly fix #152 --- GK6X/KeyboardState.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))