diff --git a/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs b/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs index 0c55b47..260ed0a 100644 --- a/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs +++ b/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs @@ -50,8 +50,8 @@ public partial class SharpIdeCodeEdit : CodeEdit public override void _ExitTree() { - _currentFile.FileContentsChangedExternallyFromDisk.Unsubscribe(OnFileChangedExternallyFromDisk); - _currentFile.FileContentsChangedExternally.Unsubscribe(OnFileChangedExternallyInMemory); + _currentFile?.FileContentsChangedExternallyFromDisk.Unsubscribe(OnFileChangedExternallyFromDisk); + _currentFile?.FileContentsChangedExternally.Unsubscribe(OnFileChangedExternallyInMemory); } private void OnBreakpointToggled(long line)