Null conditional on current app when connection closes.

This commit is contained in:
Jared 2021-01-21 07:54:51 -08:00 committed by Jared Goodwin
parent db17d8d948
commit cbe3447e70

View File

@ -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";