diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-06-12 09:46:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-12 09:46:33 +0200 |
commit | a4583657802b923e48009bb01a2c7ac5d7e6f186 (patch) | |
tree | 9ab909f49d5bc44afcab71113e1f1552f181e8f0 | |
parent | bf50ed63642808f316b448be0ed9a13b68303ddf (diff) | |
parent | b3010d9734e43dd7d7f3214880fe0139e6da7e7f (diff) |
Merge pull request #29659 from YeldhamDev/script_connections_node_deleted
Fix connection info still appearing on scripts if the node source is deleted
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 79867f40ca..1b71f6800a 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -872,6 +872,12 @@ void ScriptTextEditor::_update_connected_methods() { continue; } + // As deleted nodes are still accessible via the undo/redo system, check if they're still on the tree. + Node *source = Object::cast_to<Node>(connection.source); + if (source && !source->is_inside_tree()) { + continue; + } + int line = script->get_language()->find_function(connection.method, text_edit->get_text()); if (line < 0) { missing_connections.push_back(connection); |