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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-04-17 14:48:39 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-04-17 14:49:31 +0300
commitc991bb0baf60a1bd2ab73dc5ccaf086d95c16955 (patch)
tree183e9c7317fca3249f9bac839edd174df5cb9b3a /source/blender/depsgraph/intern/depsgraph_query.cc
parentb52cd283d9512c6e1311449a22cb7b2878ed7c93 (diff)
Depsgraph: Allow querying NULL IDs for evaluated version
Saves us from extra checks for NULL pointers when using datablocks for read.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_query.cc')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_query.cc3
1 files changed, 3 insertions, 0 deletions
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.