Skip to content

Commit

Permalink
Suppress "Theme not found" if setting is empty
Browse files Browse the repository at this point in the history
(cherry picked from commit 022d6df)
  • Loading branch information
mstv committed Apr 11, 2021
1 parent 52c5c72 commit 7359a19
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions GitUI/CommandsDialogs/SettingsDialog/Pages/ColorsSettingsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private ThemeId SelectedThemeId
}
set
{
var formattedThemeId = new FormattedThemeId(value);
FormattedThemeId formattedThemeId = new(value);
int index = _NO_TRANSLATE_cbSelectTheme.Items.IndexOf(formattedThemeId);
if (index < 0)
{
Expand All @@ -47,7 +47,13 @@ private ThemeId SelectedThemeId
// - user creates custom theme and selects it in this settings page
// - user saves app settings
// - user deletes the file with custom theme
MessageBoxes.ShowError(this, "Theme not found: " + formattedThemeId);
// - on first install; suppress MessageBox
string theme = formattedThemeId.ToString();
if (!string.IsNullOrWhiteSpace(theme))
{
MessageBoxes.ShowError(FindForm(), $"Theme not found: {theme}");
}

index = 0;
}

Expand Down

0 comments on commit 7359a19

Please sign in to comment.