1
0
Fork 0

Merge pull request #114187 from bruvzg/menu_perpop_cr

Fix `PopupMenu::_pre_popup` crash outside the tree.
This commit is contained in:
Rémi Verschelde 2025-12-19 11:53:49 +01:00
commit eae8439bde
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 1 additions and 1 deletions

View File

@ -3392,7 +3392,7 @@ void PopupMenu::_pre_popup() {
p = p->get_parent();
}
if (scale_with_parent) {
if (scale_with_parent && p) {
Size2 scale = get_force_native() ? get_parent_viewport()->get_popup_base_transform_native().get_scale() : get_parent_viewport()->get_popup_base_transform().get_scale();
CanvasItem *c = Object::cast_to<CanvasItem>(get_parent());
if (c) {