From 48498b337de330fe91d1faa6b7fbcd154ea28b2f Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 13 Oct 2017 13:07:07 +0200 Subject: [PATCH] Internals: SetActiveID window cannot be NULL --- imgui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index c79284f89..340da83d6 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -1963,10 +1963,10 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) if (id) { g.NavId = id; - if (window) - g.NavLayer = window->DC.NavLayerCurrent; - if (window) // NB: We current assume that SetActiveId() is called in the context where its NavLayer is the current one, which should be the case. - window->NavLastIds[window->DC.NavLayerCurrent] = id; + + // Assume that SetActiveID() is called in the context where its NavLayer is the current layer, which is the case everywhere we call it. + g.NavLayer = window->DC.NavLayerCurrent; + window->NavLastIds[window->DC.NavLayerCurrent] = id; if (g.ActiveIdSource == ImGuiInputSource_Nav) g.NavDisableMouseHover = true; else