Fix de-referencing of null pointer in depsgraph

The accessors of original ID and objects are expected to return
nullptr for the nullptr input. This was handled explicitly in the
DEG_get_evaluated_id(), but the DEG_get_evaluated_object was using
`object->id` without check.

While it did not cause actual issue (as the id's offset is 0), this
was causing address sanitizer error print.

Pull Request: https://projects.blender.org/blender/blender/pulls/108939
This commit is contained in:
Sergey Sharybin
2023-06-13 15:41:51 +02:00
committed by Sergey Sharybin
parent 376467de3c
commit ea33172409

View File

@@ -211,6 +211,9 @@ ViewLayer *DEG_get_evaluated_view_layer(const Depsgraph *graph)
Object *DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
{
if (object == nullptr) {
return nullptr;
}
return (Object *)DEG_get_evaluated_id(depsgraph, &object->id);
}