Merge pull request #101005 from Sauermann/fix-graph-node-crash

Fix nullptr crash with freed `GraphNode` in GraphEditArranger
This commit is contained in:
Rémi Verschelde 2025-01-03 00:50:02 +01:00
commit 32b081b2ff
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -79,6 +79,9 @@ void GraphEditArranger::arrange_nodes() {
for (const Ref<GraphEdit::Connection> &connection : connection_list) {
GraphNode *p_from = Object::cast_to<GraphNode>(node_names[connection->from_node]);
if (!p_from) {
continue;
}
if (connection->to_node == graph_element->get_name() && (p_from->is_selected() || arrange_entire_graph) && connection->to_node != connection->from_node) {
if (!s.has(p_from->get_name())) {
s.insert(p_from->get_name());