Browse Source

Avoid copying a signal with a Node if the target path is empty

Sébastien Dunne Fulmer 1 năm trước cách đây
mục cha
commit
7563c3a4df
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      scene/main/node.cpp

+ 4 - 0
scene/main/node.cpp

@@ -2985,7 +2985,11 @@ void Node::_duplicate_signals(const Node *p_original, Node *p_copy) const {
 				if (!target) {
 					continue;
 				}
+
 				NodePath ptarget = p_original->get_path_to(target);
+				if (ptarget.is_empty()) {
+					continue;
+				}
 
 				Node *copytarget = target;