diff options
author | kobewi <kobewi4e@gmail.com> | 2023-05-18 19:22:23 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-05-18 19:22:23 +0200 |
commit | 7d5d5b7bd10f6fad498ec6764a3aac9745f96e1d (patch) | |
tree | 1732c2bbcb62426a662978a806be76456a207022 /editor/plugins | |
parent | 9a88b47cb1a1f893d178a085eb67c9ca39d4f210 (diff) |
Fix crash when trying to create bones from Control
(cherry picked from commit 6a120107b330c5859f934080fc4dca1c83c3a6ab)
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index f0911ce71d..bb951fbd62 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -4594,6 +4594,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { undo_redo->create_action(TTR("Create Custom Bone2D(s) from Node(s)")); for (const KeyValue<Node *, Object *> &E : selection) { Node2D *n2d = Object::cast_to<Node2D>(E.key); + if (!n2d) { + continue; + } Bone2D *new_bone = memnew(Bone2D); String new_bone_name = n2d->get_name(); |