浏览代码

Fix crash when trying to create bones from Control

kobewi 2 年之前
父节点
当前提交
6a120107b3
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      editor/plugins/canvas_item_editor_plugin.cpp

+ 3 - 0
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<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();