Better handling for null values.

This commit is contained in:
IceStormNG
2023-08-18 18:37:58 +02:00
parent 4952675749
commit 2384649e09

View File

@@ -62,12 +62,14 @@ namespace GHelper.UI
private static bool IsDarkTheme()
{
if (AppConfig.GetString("ui_mode").ToLower() == "dark")
string? uiMode = AppConfig.GetString("ui_mode");
if (uiMode is not null && uiMode.ToLower() == "dark")
{
return true;
}
if (AppConfig.GetString("ui_mode").ToLower() == "light")
if (uiMode is not null && uiMode.ToLower() == "light")
{
return false;
}