Skip to content

Commit

Permalink
Skip unsupported Lighting modes #3195
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Sep 30, 2024
1 parent 73d5a0b commit 873fcc0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions app/AsusMouseSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,8 @@ private void ComboBoxLightingMode_DropDownClosed(object? sender, EventArgs e)
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)
Expand Down

0 comments on commit 873fcc0

Please sign in to comment.