mirror of https://github.com/godotengine/godot
Merge pull request #114187 from bruvzg/menu_perpop_cr
Fix `PopupMenu::_pre_popup` crash outside the tree.
This commit is contained in:
commit
eae8439bde
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue