From 3c6257b8b9f8cb4494add15af0b913341053cefa Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 7 Apr 2015 14:04:43 +0100 Subject: [PATCH] Fixed IsRootWindowOrAnyChildFocused() crashing if no window has focus (introduced yesterday in c38c54af524280b4c7b1ddbbc8f2a6492d2c123e) --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 7b056e941..6a7048cbf 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3808,7 +3808,7 @@ bool ImGui::IsRootWindowOrAnyChildFocused() { ImGuiState& g = *GImGui; ImGuiWindow* root_window = GetCurrentWindow()->RootWindow; - return g.FocusedWindow->RootWindow == root_window; + return g.FocusedWindow && g.FocusedWindow->RootWindow == root_window; } float ImGui::GetWindowWidth()