diff --git a/Source/Editor/Windows/EditorOptionsWindow.cs b/Source/Editor/Windows/EditorOptionsWindow.cs
index dc12885a5..fee0bf30b 100644
--- a/Source/Editor/Windows/EditorOptionsWindow.cs
+++ b/Source/Editor/Windows/EditorOptionsWindow.cs
@@ -310,6 +310,8 @@ namespace FlaxEditor.Windows
private void OnSelectedTabChanged(Tabs tabs)
{
+ if (IsDisposing)
+ return;
ApplySearchFilter();
}
diff --git a/Source/Engine/UI/GUI/WindowRootControl.cs b/Source/Engine/UI/GUI/WindowRootControl.cs
index 3b4786db0..739ff2485 100644
--- a/Source/Engine/UI/GUI/WindowRootControl.cs
+++ b/Source/Engine/UI/GUI/WindowRootControl.cs
@@ -119,7 +119,8 @@ namespace FlaxEngine.GUI
/// True if move to the front by force, otherwise false.
public void BringToFront(bool force = false)
{
- _window.BringToFront(force);
+ if (_window && _window.IsVisible)
+ _window.BringToFront(force);
}
///