From 873fcc0591f9abfc539909f5d140418c90ba0633 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:58:24 +0200 Subject: [PATCH] Skip unsupported Lighting modes #3195 --- app/AsusMouseSettings.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/AsusMouseSettings.cs b/app/AsusMouseSettings.cs index 73301edc..719cf346 100644 --- a/app/AsusMouseSettings.cs +++ b/app/AsusMouseSettings.cs @@ -326,13 +326,8 @@ namespace GHelper return; } - if (comboBoxLightingMode.SelectedIndex >= supportedLightingModes.Count) - { - // Unsupported mode - return; - } - - LightingMode lm = supportedLightingModes[comboBoxLightingMode.SelectedIndex]; + var index = comboBoxLightingMode.SelectedIndex; + LightingMode lm = supportedLightingModes[index < supportedLightingModes.Count ? index : 0 ]; LightingSetting? ls = mouse.LightingSettingForZone(visibleZone); if (ls.LightingMode == lm)