diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-01-23 22:16:10 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-01-23 22:18:22 +0400 |
commit | 0f72a8a7f0a0f8fff11ee26859c33ab684d6e19b (patch) | |
tree | 452b7e4cc8ed59c7e3fd2534343f6ba46574f1a7 | |
parent | 9f903208e800d4580314dc03d31e8ae5fea73cdb (diff) |
Fix T38337: Crash when calling to_mesh() on a Curve object after clearing its parent
This is rather a workaround which only works because curve evaluation is only called
for a temporary object. Not a big deal if we'll skip path creation for such objects.
Still would need to think of general solution.
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index c6cfaaf2bcb..0e3a15b114e 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -2959,7 +2959,19 @@ 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; + + if (scene->theDag == NULL) { + /* Happens when converting objects to mesh from a python script + * after modifying scene graph. + * + * Currently harmless because it's only called for temporary + * objects which are out of the DAG anyway. + */ + return 0; + } + + node = dag_find_node(scene->theDag, object);; if (node) { return node->eval_flags; |