don't assume GetCurrentEditor() returns something

This commit is contained in:
Michael Becker 2021-08-27 20:42:26 -04:00
parent 1b28f8603d
commit c4728b6566
No known key found for this signature in database
GPG Key ID: 98C333A81F18C22C

View File

@ -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);
}