diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-25 12:01:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-25 12:01:23 +0300 |
commit | 4f3c477a85aa9c395f21830ed18e89407e9275db (patch) | |
tree | 774a2ab12571ea9b77d5751441dcbc857080714b /source/blender/makesrna/intern/rna_rna.c | |
parent | 5f4e24d5990a7ecd6198ee394da8b7c07277cd91 (diff) |
fix for segfault getting RNA Enum default values, minor updates to introspection class
Diffstat (limited to 'source/blender/makesrna/intern/rna_rna.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 5997867030d..5fd87728fb8 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -641,13 +641,18 @@ static EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, PointerRNA rna_idproperty_check(&prop, ptr); eprop= (EnumPropertyRNA*)prop; - if(eprop->itemf==NULL || eprop->itemf==rna_EnumProperty_default_itemf || !C) + if( (eprop->itemf == NULL) || + (eprop->itemf == rna_EnumProperty_default_itemf) || + (ptr->type == &RNA_EnumProperty) || + (C == NULL)) + { return eprop->item; + } return eprop->itemf(C, ptr, free); } -/* XXX - not sore this is needed? */ +/* XXX - not sure this is needed? */ static int rna_EnumProperty_default_get(PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; |