diff --git a/Desktop.Win/ViewModels/MainWindowViewModel.cs b/Desktop.Win/ViewModels/MainWindowViewModel.cs index 51f584c3e..a89fcea5b 100644 --- a/Desktop.Win/ViewModels/MainWindowViewModel.cs +++ b/Desktop.Win/ViewModels/MainWindowViewModel.cs @@ -210,7 +210,7 @@ public async Task Init() CasterSocket.Connection.Closed += async (ex) => { - await App.Current.Dispatcher.InvokeAsync(() => + await App.Current?.Dispatcher?.InvokeAsync(() => { Viewers.Clear(); SessionID = "Disconnected"; @@ -219,7 +219,7 @@ await App.Current.Dispatcher.InvokeAsync(() => CasterSocket.Connection.Reconnecting += async (ex) => { - await App.Current.Dispatcher.InvokeAsync(() => + await App.Current?.Dispatcher?.InvokeAsync(() => { Viewers.Clear(); SessionID = "Reconnecting";