From 30511fb9ac354f0a7559de3c534786052d7a42e1 Mon Sep 17 00:00:00 2001 From: Jared Date: Thu, 21 Jan 2021 07:54:51 -0800 Subject: [PATCH] Null conditional on current app when connection closes. --- Desktop.Win/ViewModels/MainWindowViewModel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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";