From c991bb0baf60a1bd2ab73dc5ccaf086d95c16955 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 17 Apr 2018 13:48:39 +0200 Subject: Depsgraph: Allow querying NULL IDs for evaluated version Saves us from extra checks for NULL pointers when using datablocks for read. --- source/blender/depsgraph/intern/depsgraph_query.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/depsgraph/intern/depsgraph_query.cc') diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc index 6f0ba26c8f7..3bffbf4d88e 100644 --- a/source/blender/depsgraph/intern/depsgraph_query.cc +++ b/source/blender/depsgraph/intern/depsgraph_query.cc @@ -151,6 +151,9 @@ Object *DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object) ID *DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *id) { + if (id == NULL) { + return NULL; + } /* TODO(sergey): This is a duplicate of Depsgraph::get_cow_id(), * but here we never do assert, since we don't know nature of the * incoming ID datablock. -- cgit v1.2.3