diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-05-08 01:19:22 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-05-08 01:19:22 +0300 |
commit | 9181f13af710f39e28368461f9979ce2052a55ee (patch) | |
tree | bb4dae8ee41e31d25ba980aa996c3e62539a59e0 /source/blender/python | |
parent | c47926542acf1fc342b4d0b8f7ccaf1e3a8be6d8 (diff) | |
parent | ce28025eaf5014f16460dd1cb798ce5292087d94 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index dc247f28539..7b9019e202e 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -3271,13 +3271,17 @@ static int pyrna_struct_ass_subscript(BPy_StructRNA *self, PyObject *key, PyObje return -1; } - BPy_StructRNA *val = (BPy_StructRNA *)value; - if (val && self->ptr.type && val->ptr.type) { - if (!RNA_struct_idprops_datablock_allowed(self->ptr.type) && - RNA_struct_idprops_contains_datablock(val->ptr.type)) - { - PyErr_SetString(PyExc_TypeError, "bpy_struct[key] = val: datablock id properties not supported for this type"); - return -1; + if (value && BPy_StructRNA_Check(value)) { + BPy_StructRNA *val = (BPy_StructRNA *)value; + if (val && self->ptr.type && val->ptr.type) { + if (!RNA_struct_idprops_datablock_allowed(self->ptr.type) && + RNA_struct_idprops_contains_datablock(val->ptr.type)) + { + PyErr_SetString( + PyExc_TypeError, + "bpy_struct[key] = val: datablock id properties not supported for this type"); + return -1; + } } } |