Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-10-07 11:06:21 +0300
committerBastien Montagne <bastien@blender.org>2020-10-07 11:18:45 +0300
commit5b97e50976b0b4c54b725dc6a85c9736904bccdb (patch)
tree1142df524ff12334161a9052575de51b84bf0dd0 /source/blender
parent084d911010fdc7905694e8be4f5d965f4f4d1415 (diff)
Fix T81272: Crash on opening old files where nodetrees had no name.
This code gets called before do_version can fix that, so we have to work around it for now.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/idtype.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/idtype.c b/source/blender/blenkernel/intern/idtype.c
index 6ef3817bc1c..44bf8f0e4db 100644
--- a/source/blender/blenkernel/intern/idtype.c
+++ b/source/blender/blenkernel/intern/idtype.c
@@ -489,6 +489,11 @@ void BKE_idtype_id_foreach_cache(struct ID *id,
bNodeTree *nodetree = ntreeFromID(id);
if (nodetree != NULL) {
type_info = BKE_idtype_get_info_from_id(&nodetree->id);
+ if (type_info == NULL) {
+ /* Very old .blend file seem to have empty names for their embedded node trees, see
+ * `blo_do_versions_250()`. Assume those are nodetrees then. */
+ type_info = BKE_idtype_get_info_from_idcode(ID_NT);
+ }
if (type_info->foreach_cache != NULL) {
type_info->foreach_cache(&nodetree->id, function_callback, user_data);
}