diff --git a/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs b/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs index 21716e7..c9c788c 100644 --- a/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs +++ b/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs @@ -126,7 +126,7 @@ public partial class SharpIdeCodeEdit : CodeEdit { _currentFile?.FileContentsChangedExternally.Unsubscribe(OnFileChangedExternally); GlobalEvents.Instance.SolutionAltered.Unsubscribe(OnSolutionAltered); - _openTabsFileManager.CloseFile(_currentFile!); + if (_currentFile is not null) _openTabsFileManager.CloseFile(_currentFile); } private void OnBreakpointToggled(long line)