Skip to content

Commit 3671fc3

Browse files
committed
Adds a null check to ensure the current application is not null when we try to update the list of active applications
1 parent a7b37f5 commit 3671fc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/WinReform/WinReform/ActiveWindows/ActiveWindowsViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public void RefreshActiveWindows()
157157
Task.Run(() =>
158158
{
159159
var result = _windowService.GetActiveWindows().ToList();
160-
Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => ActiveWindows.UpdateCollection(result)));
160+
Application.Current?.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => ActiveWindows.UpdateCollection(result)));
161161
});
162162
}
163163

0 commit comments

Comments
 (0)