From 2081fc15b51f5218f3e20845a1b9b49707b93a76 Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 5 Feb 2018 12:46:13 +0100 Subject: [PATCH] Added assert in BeginChild(ImGuiId id). --- imgui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 3686c5e4..e337c97b 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3009,8 +3009,8 @@ static void ImGui::NavUpdate() // Exit child window ImGuiWindow* child_window = g.NavWindow; ImGuiWindow* parent_window = g.NavWindow->ParentWindow; - FocusWindow(parent_window); IM_ASSERT(child_window->ChildId != 0); + FocusWindow(parent_window); SetNavID(child_window->ChildId, 0); g.NavIdIsAlive = false; if (g.NavDisableMouseHover) @@ -5009,6 +5009,7 @@ bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, bool ImGui::BeginChild(ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags) { + IM_ASSERT(id != 0); return BeginChildEx(NULL, id, size_arg, border, extra_flags); }