From 99be5302a624b0742390024cb6842fb8ec32e1ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Fri, 19 Dec 2025 09:32:54 +0200 Subject: [PATCH] Fix `PopupMenu::_pre_popup` crash outside the tree. --- scene/gui/popup_menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 9a1fcb5e415..e1e939c23da 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -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(get_parent()); if (c) {