Commit: e22247a965e2c55be08a9b091f5663a55d7a59ca
Author: Jacques Lucke
Date:   Sat Jan 7 20:54:14 2023 +0100
Branches: master
https://developer.blender.org/rBe22247a965e2c55be08a9b091f5663a55d7a59ca

Fix: crash when opening file with visible node editor

Caused by rB87fd798ae383a344d51dcbd9f66d5834595bdc5a.

===================================================================

M       source/blender/editors/space_node/node_edit.cc

===================================================================

diff --git a/source/blender/editors/space_node/node_edit.cc 
b/source/blender/editors/space_node/node_edit.cc
index 336ed1cb6d3..fa26455f01c 100644
--- a/source/blender/editors/space_node/node_edit.cc
+++ b/source/blender/editors/space_node/node_edit.cc
@@ -1131,6 +1131,10 @@ bNodeSocket *node_find_indicated_socket(SpaceNode &snode,
 
   snode.edittree->ensure_topology_cache();
   const Span<float2> socket_locations = snode.runtime->all_socket_locations;
+  if (socket_locations.is_empty()) {
+    /* Sockets haven't been drawn yet, e.g. when the file is currently 
opening. */
+    return nullptr;
+  }
 
   const Span<bNode *> nodes = snode.edittree->all_nodes();
   for (int i = nodes.index_range().last(); i >= 0; i--) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to