diff options
author | Jacques Lucke <jacques@blender.org> | 2021-03-29 17:56:53 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-03-29 17:57:03 +0300 |
commit | 81fae56cb9213ca7d64ac97bef7f7447fb96924f (patch) | |
tree | ae0fe3bb55f94f080405b2906b3e027769ec2259 /source/blender | |
parent | bc872e0c8e3e951aff6363acb4372b498a256d18 (diff) |
Fix T86298: crash when loading "corrupted" geometry node tree
The file was not really corrupted (as in, Blender did everything
correctly while saving). I only did not consider the case when
a .blend file is resaved in an older version before.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/node.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 08a9628a6e6..315ff40289d 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -778,6 +778,13 @@ static void lib_link_node_socket(BlendLibReader *reader, Library *lib, bNodeSock { IDP_BlendReadLib(reader, sock->prop); + /* This can happen for all socket types when a file is saved in an older version of Blender than + * it was originally created in (T86298). Some socket types still require a default value. The + * default value of those sockets will be created in `ntreeSetTypes`. */ + if (sock->default_value == nullptr) { + return; + } + switch ((eNodeSocketDatatype)sock->type) { case SOCK_OBJECT: { bNodeSocketValueObject *default_value = (bNodeSocketValueObject *)sock->default_value; |