diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-03 17:43:12 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-03 17:43:12 +0400 |
commit | 13ec0cd6c3c74c7f324cefff064bb725cc26fcd2 (patch) | |
tree | 52d34328fc2ee27ab01da20406f1737aaa2f752e /source/blender/python | |
parent | 07677e836ff0d11d98da2d11c41b058966d06c6a (diff) |
Fix #34856: crash passing an object rather than a mesh to bpy.data.mesh.remove(),
this should give an error message but it didn't.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 735df7aeb10..d6a82ce43ea 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1778,8 +1778,10 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb if (flag & PROP_THICK_WRAP) { if (value == Py_None) memset(data, 0, sizeof(PointerRNA)); - else + else if (RNA_struct_is_a(param->ptr.type, ptr_type)) *((PointerRNA *)data) = param->ptr; + else + raise_error = true; } else { /* for function calls, we sometimes want to pass the 'ptr' directly, @@ -1787,8 +1789,10 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb BLI_assert(value_new == NULL); if (value == Py_None) *((void **)data) = NULL; - else + else if (RNA_struct_is_a(param->ptr.type, ptr_type)) *((PointerRNA **)data) = ¶m->ptr; + else + raise_error = true; } } else if (value == Py_None) { |