From c3ffbe2f420f9b69a3fc8f91775eb5dad5f7a7fb Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Mon, 6 Jan 2025 01:30:32 +0200 Subject: [PATCH] Fix error when docking to sides of tabbed panel --- Source/Editor/GUI/Docking/DockHintWindow.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/Editor/GUI/Docking/DockHintWindow.cs b/Source/Editor/GUI/Docking/DockHintWindow.cs index 8ff01b132..e0950f228 100644 --- a/Source/Editor/GUI/Docking/DockHintWindow.cs +++ b/Source/Editor/GUI/Docking/DockHintWindow.cs @@ -149,13 +149,16 @@ namespace FlaxEditor.GUI.Docking var selectedTab = _toMove.SelectedTab; // Dock the first tab into the target location - var firstTab = _toMove.GetTab(0); - firstTab.Show(_toSet, _toDock); - - // Dock rest of the tabs - while (_toMove.TabsCount > 0) + if (_toMove.TabsCount > 0) { - _toMove.GetTab(0).Show(DockState.DockFill, firstTab); + var firstTab = _toMove.GetTab(0); + firstTab.Show(_toSet, _toDock); + + // Dock rest of the tabs + while (_toMove.TabsCount > 0) + { + _toMove.GetTab(0).Show(DockState.DockFill, firstTab); + } } // Keep selected tab being selected