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>2022-05-25 12:22:17 +0300
committerBastien Montagne <bastien@blender.org>2022-05-25 12:22:17 +0300
commitcb3b9358bfb482c1968bdd6d3e5d84101c4ecb77 (patch)
tree8952e3ba0d2a2a4d958ce7fd292bd7f88e345a7a /source/blender/blenkernel
parenta4e7a5aa4f6dcb8d9bb5332849b2b48dde585584 (diff)
Fix T98344: Crash opening file with proxy.
Weird file where the proxy object has a `proxy_group` pointer, which does not instantiate any collection...
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/lib_override_proxy_conversion.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/lib_override_proxy_conversion.c b/source/blender/blenkernel/intern/lib_override_proxy_conversion.c
index 5e9d8e8c4d0..7fa9ba5dca9 100644
--- a/source/blender/blenkernel/intern/lib_override_proxy_conversion.c
+++ b/source/blender/blenkernel/intern/lib_override_proxy_conversion.c
@@ -39,7 +39,8 @@ bool BKE_lib_override_library_proxy_convert(Main *bmain,
/* `proxy_group`, if defined, is the empty instantiating the collection from which the proxy is
* coming. */
Object *ob_proxy_group = ob_proxy->proxy_group;
- const bool is_override_instancing_object = ob_proxy_group != NULL;
+ const bool is_override_instancing_object = (ob_proxy_group != NULL) &&
+ (ob_proxy_group->instance_collection != NULL);
ID *id_root = is_override_instancing_object ? &ob_proxy_group->instance_collection->id :
&ob_proxy->proxy->id;
ID *id_instance_hint = is_override_instancing_object ? &ob_proxy_group->id : &ob_proxy->id;