diff --git a/Flow.Launcher.Core/Resource/Theme.cs b/Flow.Launcher.Core/Resource/Theme.cs index 76a74b711..be849228a 100644 --- a/Flow.Launcher.Core/Resource/Theme.cs +++ b/Flow.Launcher.Core/Resource/Theme.cs @@ -644,7 +644,8 @@ namespace Flow.Launcher.Core.Resource /// public async Task RefreshFrameAsync() { - if (Application.Current?.Dispatcher.CheckAccess() != true) + if (Application.Current == null) return; + if (!Application.Current.Dispatcher.CheckAccess()) { await Application.Current?.Dispatcher.InvokeAsync(RefreshFrameAsync); return; @@ -676,9 +677,10 @@ namespace Flow.Launcher.Core.Resource /// public async Task SetBlurForWindowAsync() { - if (Application.Current?.Dispatcher.CheckAccess() != true) + if (Application.Current == null) return; + if (!Application.Current.Dispatcher.CheckAccess()) { - await Application.Current?.Dispatcher.InvokeAsync(RefreshFrameAsync); + await Application.Current?.Dispatcher.InvokeAsync(SetBlurForWindowAsync); return; }