From 3a5e758ee37582a52360ada72219d5162ddd3268 Mon Sep 17 00:00:00 2001 From: omar Date: Sat, 8 Dec 2018 12:35:15 +0100 Subject: [PATCH] Tabs: Fixed crash when using TabItem in a regular (non-docking) tab bar. (#2231) --- imgui_widgets.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index b0a0c68f..086550a8 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -6455,8 +6455,8 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, // Drag and drop a single floating window node moves it // FIXME-DOCK: In theory we shouldn't test for the ConfigDockingNodifySingleWindows flag here. // When our single window node and OnlyNodeWithWindows are working properly we may remove this check here. - ImGuiDockNode* node = docked_window->DockNode; - const bool single_window_node = node->IsRootNode() && node->Windows.Size == 1 && g.IO.ConfigDockingTabBarOnSingleWindows; + ImGuiDockNode* node = docked_window ? docked_window->DockNode : NULL; + const bool single_window_node = node && node->IsRootNode() && node->Windows.Size == 1 && g.IO.ConfigDockingTabBarOnSingleWindows; if (held && single_window_node && IsMouseDragging(0, 0.0f)) { // Move