From 69a6562482083101504346adb4bb505a11839d6a Mon Sep 17 00:00:00 2001 From: Lukasz Baldyga Date: Fri, 23 Oct 2020 02:42:45 +0100 Subject: [PATCH] Fixed bug where closing text editor would make it crash --- .../Advanced Software Engineering/TextEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Advanced Software Engineering/Advanced Software Engineering/TextEditor.cs b/Advanced Software Engineering/Advanced Software Engineering/TextEditor.cs index 88b04a6..44969bc 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/TextEditor.cs +++ b/Advanced Software Engineering/Advanced Software Engineering/TextEditor.cs @@ -47,7 +47,7 @@ namespace Advanced_Software_Engineering { } private void Console_FormClosed(object sender, FormClosedEventArgs e) { - if (DisplayForm != null || !DisplayForm.IsDisposed) DisplayForm.ReleaseCommandLock(); + if (DisplayForm != null && !DisplayForm.IsDisposed) DisplayForm.ReleaseCommandLock(); SettingsAndHelperFunctions.WindowClosed(); Dispose(); }