Skip to content

Commit

Permalink
Nav: Fixed race condition pressing Esc during popup opening frame cau…
Browse files Browse the repository at this point in the history
…sing crash.
  • Loading branch information
ocornut committed Sep 29, 2022
1 parent bd2355a commit 9f6aae3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10859,7 +10859,7 @@ static void ImGui::NavUpdateCancelRequest()
SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, WindowRectAbsToRel(parent_window, child_rect));
NavRestoreHighlightAfterMove();
}
else if (g.OpenPopupStack.Size > 0 && !(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal))
else if (g.OpenPopupStack.Size > 0 && g.OpenPopupStack.back().Window != NULL && !(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal))
{
// Close open popup/menu
ClosePopupToLevel(g.OpenPopupStack.Size - 1, true);
Expand Down

0 comments on commit 9f6aae3

Please sign in to comment.