diff options
author | Bastien Montagne <bastien@blender.org> | 2021-07-27 18:39:46 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-07-27 18:41:15 +0300 |
commit | f4abd3cfc43cff5b0b8c1df85bf2983fbf45906a (patch) | |
tree | 53128aa0a586a846b0aaaa57a2bbd962166b1f56 /source/blender/blenkernel/intern | |
parent | 4a02b9ffeb018ced11768ca99935fda5fa5f7da0 (diff) |
Fix LibOverride crashing in some cases where reference linked data gets MIA.
When the root of an override hierarchy disapears, there is no way to do
a proper resync, just abort.
Reported by studio, thx.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 0ef9692f7e5..8b63594955f 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -1013,6 +1013,15 @@ bool BKE_lib_override_library_resync(Main *bmain, ID *id_root_reference = id_root->override_library->reference; + if (id_root_reference->tag & LIB_TAG_MISSING) { + BKE_reportf(reports != NULL ? reports->reports : NULL, + RPT_ERROR, + "impossible to resync data-block %s and its dependencies, as its linked reference " + "is missing", + id_root->name + 2); + return false; + } + BKE_main_relations_create(bmain, 0); LibOverrideGroupTagData data = {.bmain = bmain, .scene = scene, |