diff --git a/RGB.NET.Devices.Logitech/PerKey/LogitechPerKeyUpdateQueue.cs b/RGB.NET.Devices.Logitech/PerKey/LogitechPerKeyUpdateQueue.cs index fb238ca..4203842 100644 --- a/RGB.NET.Devices.Logitech/PerKey/LogitechPerKeyUpdateQueue.cs +++ b/RGB.NET.Devices.Logitech/PerKey/LogitechPerKeyUpdateQueue.cs @@ -38,7 +38,11 @@ namespace RGB.NET.Devices.Logitech Array.Clear(_bitmap, 0, _bitmap.Length); foreach ((object key, Color color) in dataSet) - BitmapMapping.SetColor(_bitmap, (int)key, color); + { + int offset = key as int? ?? -1; + if (offset >= 0) + BitmapMapping.SetColor(_bitmap, offset, color); + } _LogitechGSDK.LogiLedSetLightingFromBitmap(_bitmap); }