From c4728b6566060b385a140e9056bb5cf09e1a7679 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Fri, 27 Aug 2021 20:42:26 -0400 Subject: [PATCH] don't assume GetCurrentEditor() returns something --- Libraries/UniversalEditor.UserInterface/MainWindow.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Libraries/UniversalEditor.UserInterface/MainWindow.cs b/Libraries/UniversalEditor.UserInterface/MainWindow.cs index 12b9c98e..9376e1ba 100644 --- a/Libraries/UniversalEditor.UserInterface/MainWindow.cs +++ b/Libraries/UniversalEditor.UserInterface/MainWindow.cs @@ -1285,8 +1285,12 @@ namespace UniversalEditor.UserInterface Pages.EditorPage currentEditorPage = GetCurrentEditorPage(); if (currentEditorPage != null) { - if (!GetCurrentEditor().NotifySaving()) - return false; + Editor editor = GetCurrentEditor(); + if (editor != null) + { + if (!GetCurrentEditor().NotifySaving()) + return false; + } return SaveFile(currentEditorPage.Document); }