Safeguard to prevent users from choosing invalid options.

This commit is contained in:
IceStormNG
2023-07-26 21:16:30 +02:00
parent 254e6a8633
commit e16a50f1f2

View File

@@ -97,7 +97,14 @@ namespace GHelper.Helpers
//3 = Shutdown
private static int GetDefaultLidAction()
{
return AppConfig.Get("clamshell_default_lid_action", 1);
int val = AppConfig.Get("clamshell_default_lid_action", 1);
if (val < 0 || val > 3)
{
val = 1;
}
return val;
}
}
}