diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-12-19 22:53:19 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-12-19 22:56:14 +0300 |
commit | b0d61ea77089adc1722ee0e23e4be323c4d6899c (patch) | |
tree | 851537c11201a0d38511f4d6da26acb7aad18772 /source/blender/makesrna/intern/rna_rna.c | |
parent | 433c74d9f7b6ae1e38eb71dfb19d6adc2f383047 (diff) |
Fix crash in RNA when accessing empty property_tags list
E.g. running `bpy.context.active_object.cycles.bl_rna.property` in the
console would crash.
Thanks @lijenstina for reporting!
Diffstat (limited to 'source/blender/makesrna/intern/rna_rna.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 507262675b3..6cd748c0026 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -335,7 +335,7 @@ static void rna_Struct_property_tags_begin(CollectionPropertyIterator *iter, Poi /* here ptr->data should always be the same as iter->parent.type */ StructRNA *srna = (StructRNA *)ptr->data; const EnumPropertyItem *tag_defines = RNA_struct_property_tag_defines(srna); - unsigned int tag_count = RNA_enum_items_count(tag_defines); + unsigned int tag_count = tag_defines ? RNA_enum_items_count(tag_defines) : 0; rna_iterator_array_begin(iter, (void *)tag_defines, sizeof(EnumPropertyItem), tag_count, 0, NULL); } |