From 63e8f9b45ea4f2bc736f8d80545fe846c4c109a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Thu, 6 Aug 2020 14:06:29 +0200 Subject: [PATCH] SEBWIN-415: Fixed client hang after startup failure. --- SafeExamBrowser.Client.UnitTests/ClientControllerTests.cs | 3 +++ .../SafeExamBrowser.Client.UnitTests.csproj | 4 ++++ SafeExamBrowser.Client/ClientController.cs | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/SafeExamBrowser.Client.UnitTests/ClientControllerTests.cs b/SafeExamBrowser.Client.UnitTests/ClientControllerTests.cs index 800524b3..693add32 100644 --- a/SafeExamBrowser.Client.UnitTests/ClientControllerTests.cs +++ b/SafeExamBrowser.Client.UnitTests/ClientControllerTests.cs @@ -874,8 +874,11 @@ namespace SafeExamBrowser.Client.UnitTests [TestMethod] public void Shutdown_MustNotFailIfDependenciesAreNull() { + context.AppConfig = null; context.Browser = null; context.ClientHost = null; + context.Server = null; + context.Settings = null; sut.Terminate(); } diff --git a/SafeExamBrowser.Client.UnitTests/SafeExamBrowser.Client.UnitTests.csproj b/SafeExamBrowser.Client.UnitTests/SafeExamBrowser.Client.UnitTests.csproj index 46a6bb67..97b8acd6 100644 --- a/SafeExamBrowser.Client.UnitTests/SafeExamBrowser.Client.UnitTests.csproj +++ b/SafeExamBrowser.Client.UnitTests/SafeExamBrowser.Client.UnitTests.csproj @@ -156,6 +156,10 @@ {6d563a30-366d-4c35-815b-2c9e6872278b} SafeExamBrowser.Monitoring.Contracts + + {db701e6f-bddc-4cec-b662-335a9dc11809} + SafeExamBrowser.Server.Contracts + {30b2d907-5861-4f39-abad-c4abf1b3470e} SafeExamBrowser.Settings diff --git a/SafeExamBrowser.Client/ClientController.cs b/SafeExamBrowser.Client/ClientController.cs index 11f5c5bc..7235d08f 100644 --- a/SafeExamBrowser.Client/ClientController.cs +++ b/SafeExamBrowser.Client/ClientController.cs @@ -251,12 +251,12 @@ namespace SafeExamBrowser.Client private void CloseShell() { - if (Settings.ActionCenter.EnableActionCenter) + if (Settings?.ActionCenter.EnableActionCenter == true) { actionCenter.Close(); } - if (Settings.Taskbar.EnableTaskbar) + if (Settings?.Taskbar.EnableTaskbar == true) { taskbar.Close(); }