1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

Fix PopupMenu::_pre_popup crash outside the tree.

This commit is contained in:
Pāvels Nadtočajevs
2025-12-19 09:32:54 +02:00
parent 40cf5a0f50
commit 99be5302a6

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) {