diff --git a/imgui.cpp b/imgui.cpp index 7b056e94..6a7048cb 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()