From 6a120107b330c5859f934080fc4dca1c83c3a6ab Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 17 May 2023 15:53:49 +0200 Subject: [PATCH] Fix crash when trying to create bones from Control --- editor/plugins/canvas_item_editor_plugin.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 05a024f913b..2a04f7b174b 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -4592,6 +4592,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { undo_redo->create_action(TTR("Create Custom Bone2D(s) from Node(s)")); for (const KeyValue &E : selection) { Node2D *n2d = Object::cast_to(E.key); + if (!n2d) { + continue; + } Bone2D *new_bone = memnew(Bone2D); String new_bone_name = n2d->get_name();