1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Fix Crash with GraphNode

When using `queue_free()` on GraphNodes, `p_from` can become `nullprt`.
This PR adds a check to prevent crashes in these situations.
This commit is contained in:
Markus Sauermann
2025-01-01 22:20:57 +01:00
parent 2582793d40
commit 54373160df

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());