Skip to content

Commit fc1fe58

Browse files
authored
Merge pull request #1101 from dremin/fix-first-start-error
Fix error opening Properties without custom themes
2 parents a81ba92 + 47e139c commit fc1fe58

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

RetroBar/PropertiesWindow.xaml.cs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,22 @@ private void LoadThemes()
197197
{
198198
cboThemeSelect.Items.Add(theme);
199199
}
200-
201-
_themesWatcher = new FileSystemWatcher(_dictionaryManager.GetThemeInstallDir());
202-
_themesWatcher.Created += ThemesWatcher_Created;
203-
_themesWatcher.Deleted += ThemesWatcher_Deleted;
204-
_themesWatcher.Renamed += ThemesWatcher_Renamed;
205-
_themesWatcher.Filter = "*.xaml";
206-
_themesWatcher.EnableRaisingEvents = true;
200+
try
201+
{
202+
string path = _dictionaryManager.GetThemeInstallDir();
203+
Directory.CreateDirectory(path);
204+
205+
_themesWatcher = new FileSystemWatcher(_dictionaryManager.GetThemeInstallDir());
206+
_themesWatcher.Created += ThemesWatcher_Created;
207+
_themesWatcher.Deleted += ThemesWatcher_Deleted;
208+
_themesWatcher.Renamed += ThemesWatcher_Renamed;
209+
_themesWatcher.Filter = "*.xaml";
210+
_themesWatcher.EnableRaisingEvents = true;
211+
}
212+
catch (Exception e)
213+
{
214+
ShellLogger.Warning($"Unable to watch custom themes directory: {e}");
215+
}
207216
}
208217

209218
private void ThemesWatcher_Created(object sender, FileSystemEventArgs e)

0 commit comments

Comments
 (0)