Bladeren bron

Fixed IsRootWindowOrAnyChildFocused() crashing if no window has focus (introduced yesterday in c38c54af524280b4c7b1ddbbc8f2a6492d2c123e)

ocornut 10 jaren geleden
bovenliggende
commit
3c6257b8b9
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      imgui.cpp

+ 1 - 1
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()