From cbe3447e70a05517aa28532e42467e2fd1fe1623 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 51f584c3..a89fcea5 100644 --- a/Desktop.Win/ViewModels/MainWindowViewModel.cs +++ b/Desktop.Win/ViewModels/MainWindowViewModel.cs @@ -210,7 +210,7 @@ namespace Remotely.Desktop.Win.ViewModels CasterSocket.Connection.Closed += async (ex) => { - await App.Current.Dispatcher.InvokeAsync(() => + await App.Current?.Dispatcher?.InvokeAsync(() => { Viewers.Clear(); SessionID = "Disconnected"; @@ -219,7 +219,7 @@ namespace Remotely.Desktop.Win.ViewModels CasterSocket.Connection.Reconnecting += async (ex) => { - await App.Current.Dispatcher.InvokeAsync(() => + await App.Current?.Dispatcher?.InvokeAsync(() => { Viewers.Clear(); SessionID = "Reconnecting";