diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-25 20:03:49 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-26 17:37:59 +0300 |
commit | d60be68100cd306d8e1234b89b2741dc4423a332 (patch) | |
tree | 54bc4ea3eccdef3b9758f76dcfc0f29edf128303 | |
parent | a31807ed7c755e65bd244025bd575fd2b183561a (diff) |
Fix crash with depsgraph iterator and empty scene.
This causes crashes in the view layer tests.
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_query_iter.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_query_iter.cc b/source/blender/depsgraph/intern/depsgraph_query_iter.cc index 6e8e474fca6..baa87aefd64 100644 --- a/source/blender/depsgraph/intern/depsgraph_query_iter.cc +++ b/source/blender/depsgraph/intern/depsgraph_query_iter.cc @@ -205,6 +205,7 @@ void DEG_iterator_objects_begin(BLI_Iterator *iter, DEGObjectIterData *data) const size_t num_id_nodes = deg_graph->id_nodes.size(); if (num_id_nodes == 0) { + iter->data = NULL; iter->valid = false; return; } @@ -265,10 +266,13 @@ void DEG_iterator_objects_end(BLI_Iterator *iter) { #ifndef NDEBUG DEGObjectIterData *data = (DEGObjectIterData *)iter->data; - /* Force crash in case the iterator data is referenced and accessed down - * the line. (T51718) - */ - memset(&data->temp_dupli_object, 0xff, sizeof(data->temp_dupli_object)); + + if (data) { + /* Force crash in case the iterator data is referenced and accessed down + * the line. (T51718) + */ + memset(&data->temp_dupli_object, 0xff, sizeof(data->temp_dupli_object)); + } #else (void) iter; #endif |