Merge pull request #77160 from KoBeWi/Control_is_invertebrate

Fix crash when trying to create bones from Control
This commit is contained in:
Rémi Verschelde 2023-05-17 15:59:28 +02:00
commit 6d3935d42d
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -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<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();