diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-09 08:39:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-09 08:39:47 +0400 |
commit | 9a6a791ff0c9b32f66831f5e09d7c283ac309b95 (patch) | |
tree | 0777f6caf5134d5d3e3babf7757340cb06d83686 /source/blender/makesrna/intern/rna_define.c | |
parent | b7113002dbea417617e3ef655d42732ade16577e (diff) |
fix [#30865] Crash when browsing last operators in outliner (or by Python API)
Operator descriptions can be NULL pointers,
fix this by making use of PROP_NEVER_NULL flag, when its not set, generated string funcs will test for NULL.
Diffstat (limited to 'source/blender/makesrna/intern/rna_define.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index e106f8236c9..abaf598d4cc 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -949,7 +949,6 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier StringPropertyRNA *sprop = (StringPropertyRNA*)prop; sprop->defaultvalue = ""; - sprop->maxlength = 0; break; } case PROP_ENUM: @@ -983,6 +982,12 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier prop->flag |= PROP_ANIMATABLE; } + if (type == PROP_STRING) { + /* used so generated 'get/length/set' functions skip a NULL check + * in some cases we want it */ + RNA_def_property_flag(prop, PROP_NEVER_NULL); + } + if (DefRNA.preprocess) { switch (type) { case PROP_BOOLEAN: |