Skip to content

Commit

Permalink
Null conditional on current app when connection closes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Jan 21, 2021
1 parent f4c3cc4 commit 30511fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Desktop.Win/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down

0 comments on commit 30511fb

Please sign in to comment.