diff --git a/src/client/spark/view/Utility/ThreadedWindowLauncher.cs b/src/client/spark/view/Utility/ThreadedWindowLauncher.cs index 74ac38dd9..2af677603 100644 --- a/src/client/spark/view/Utility/ThreadedWindowLauncher.cs +++ b/src/client/spark/view/Utility/ThreadedWindowLauncher.cs @@ -53,6 +53,7 @@ namespace mbts.ui.utilities { int count = 0; var stopwatch = new Stopwatch(); stopwatch.Start(); + // dc.dispatcher is only assigned once, so it is safe to access it after a null check (despite this being multithreaded code) while (dc.dispatcher == null || dc.dispatcher.HasShutdownStarted) { await Task.Delay(100); if (++count == max_loops) {