From 71febcbae04a24b63356740f0f8150c2cf5eb57f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 24 Nov 2017 15:10:34 +0100 Subject: [PATCH] Depsgraph: Make code a bit more robust against tagging indirectly linked objects --- .../blender/depsgraph/intern/depsgraph_tag.cc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 2e6d5043336..82bc74fa56f 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -299,16 +299,27 @@ void id_tag_update_select_update(Depsgraph *graph, IDDepsNode *id_node) * road. */ component = id_node->find_component(DEG_NODE_TYPE_LAYER_COLLECTIONS); - node = component->find_operation(DEG_OPCODE_VIEW_LAYER_DONE); + BLI_assert(component != NULL); + if (component != NULL) { + node = component->find_operation(DEG_OPCODE_VIEW_LAYER_DONE); + } } else if (id_type == ID_OB) { component = id_node->find_component(DEG_NODE_TYPE_LAYER_COLLECTIONS); - node = component->find_operation(DEG_OPCODE_OBJECT_BASE_FLAGS); + /* NOTE: This component might be missing for indirectly linked + * objects. + */ + if (component != NULL) { + node = component->find_operation(DEG_OPCODE_OBJECT_BASE_FLAGS); + } } else { component = id_node->find_component(DEG_NODE_TYPE_BATCH_CACHE); - node = component->find_operation(DEG_OPCODE_GEOMETRY_SELECT_UPDATE, - "", -1); + BLI_assert(component != NULL); + if (component != NULL) { + node = component->find_operation(DEG_OPCODE_GEOMETRY_SELECT_UPDATE, + "", -1); + } } if (node != NULL) { node->tag_update(graph);