Skip to content

Commit 7d677fe

Browse files
committed
Merge pull request #96372 from CreatedBySeb/fix-signal-copying
Fix copying a Node with a signal potentially resulting in an Editor crash
2 parents 8b64454 + 7563c3a commit 7d677fe

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

editor/connections_dialog.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,13 @@ void ConnectDialog::_update_ok_enabled() {
453453
}
454454

455455
void ConnectDialog::_update_warning_label() {
456-
Ref<Script> scr = source->get_node(dst_path)->get_script();
456+
Node *dst = source->get_node(dst_path);
457+
if (dst == nullptr) {
458+
warning_label->set_visible(false);
459+
return;
460+
}
461+
462+
Ref<Script> scr = dst->get_script();
457463
if (scr.is_null()) {
458464
warning_label->set_visible(false);
459465
return;

scene/main/node.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3063,7 +3063,11 @@ void Node::_duplicate_signals(const Node *p_original, Node *p_copy) const {
30633063
if (!target) {
30643064
continue;
30653065
}
3066+
30663067
NodePath ptarget = p_original->get_path_to(target);
3068+
if (ptarget.is_empty()) {
3069+
continue;
3070+
}
30673071

30683072
Node *copytarget = target;
30693073

0 commit comments

Comments
 (0)