Merge pull request #29659 from YeldhamDev/script_connections_node_deleted

Fix connection info still appearing on scripts if the node source is deleted
This commit is contained in:
Rémi Verschelde 2019-06-12 09:46:33 +02:00 committed by GitHub
commit a458365780
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -872,6 +872,12 @@ void ScriptTextEditor::_update_connected_methods() {
continue; 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()); int line = script->get_language()->find_function(connection.method, text_edit->get_text());
if (line < 0) { if (line < 0) {
missing_connections.push_back(connection); missing_connections.push_back(connection);