Commit: d60be68100cd306d8e1234b89b2741dc4423a332
Author: Brecht Van Lommel
Date:   Wed Apr 25 19:03:49 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd60be68100cd306d8e1234b89b2741dc4423a332

Fix crash with depsgraph iterator and empty scene.

This causes crashes in the view layer tests.

===================================================================

M       source/blender/depsgraph/intern/depsgraph_query_iter.cc

===================================================================

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

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to