diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-01-15 14:25:28 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-01-15 14:27:25 +0400 |
commit | 1ad4b85e8f1e06cbbf9523146cafd37d9d2d1fd1 (patch) | |
tree | afad0b4e91b4ae36efc353fde8665f186b8445a1 /source/blender/blenkernel/intern/depsgraph.c | |
parent | 5cd321203eb6cfaaaeb9f00fde2f3e4e161cf09c (diff) |
Fix T38224: Blender crashes on duplicating curve
Issue is caused by the evaluation flags getter called with
NULL depsgraph. It happens on direct object update from the
transform code after duplicating the curve.
Proper solution is probably to make sure depsgraph is rebuild
after duplication, but for now it's better to prevent crashes.
Diffstat (limited to 'source/blender/blenkernel/intern/depsgraph.c')
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 539ed8f2e57..dd1f9539b82 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -2910,7 +2910,17 @@ const char *DAG_get_node_name(void *node_v) short DAG_get_eval_flags_for_object(struct Scene *scene, void *object) { - DagNode *node = dag_find_node(scene->theDag, object); + DagNode *node = NULL; + + if (scene->theDag) { + /* DAG happens to be NULL when doing direct object update + * during transform after duplication, see T38224. + * + * Not sure whether such a NULL check will always work, + * but for now it's better than crash anyway. + */ + dag_find_node(scene->theDag, object); + } if (node) { return node->eval_flags; |