diff --git a/src/modules/peek/Peek.UI/MainWindow.xaml.cs b/src/modules/peek/Peek.UI/MainWindow.xaml.cs index 4a40a1b623..cf7042023e 100644 --- a/src/modules/peek/Peek.UI/MainWindow.xaml.cs +++ b/src/modules/peek/Peek.UI/MainWindow.xaml.cs @@ -27,15 +27,22 @@ namespace Peek.UI { public MainWindowViewModel ViewModel { get; } - private ThemeListener themeListener; + private ThemeListener? themeListener; public MainWindow() { InitializeComponent(); this.Activated += PeekWindow_Activated; - themeListener = new ThemeListener(); - themeListener.ThemeChanged += (_) => HandleThemeChange(); + try + { + themeListener = new ThemeListener(); + themeListener.ThemeChanged += (_) => HandleThemeChange(); + } + catch (Exception e) + { + Logger.LogError($"HandleThemeChange exception. Please install .NET 4.", e); + } ViewModel = App.GetService();