diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-14 01:47:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-14 01:47:23 +0300 |
commit | c1d29ea7835c0f2ebd20531dfe3996c6bbce6b58 (patch) | |
tree | d7854c52ba16975cb31910bfd5ad041b1ed71213 /source/blender/makesrna/intern | |
parent | a5a86f39212fb16c8310d8eca67ccecc4c6f7dd7 (diff) |
WM: enforce descriptions being NULL or defined
Without this bugs slip through that don't null check the descriptions
since many were set to empty strings.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_ui.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 782d39bcb7e..c6dc0c1b124 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -759,8 +759,9 @@ static StructRNA *rna_Menu_register( memcpy(buf, _menu_descr, description_size); mt->description = buf; } - else - mt->description = ""; + else { + mt->description = NULL; + } mt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, mt->idname, &RNA_Menu); RNA_def_struct_translation_context(mt->ext.srna, mt->translation_context); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index d0d01b9e43e..9b2cc850169 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -1187,7 +1187,7 @@ static StructRNA *rna_Operator_register( dummyot.idname = strings_table[0]; /* allocated string stored here */ dummyot.name = strings_table[1]; - dummyot.description = strings_table[2]; + dummyot.description = *strings_table[2] ? strings_table[2] : NULL; dummyot.translation_context = strings_table[3]; dummyot.undo_group = strings_table[4]; BLI_assert(ARRAY_SIZE(strings) == 5); @@ -1328,7 +1328,7 @@ static StructRNA *rna_MacroOperator_register( dummyot.idname = strings_table[0]; /* allocated string stored here */ dummyot.name = strings_table[1]; - dummyot.description = strings_table[2]; + dummyot.description = *strings_table[2] ? strings_table[2] : NULL; dummyot.translation_context = strings_table[3]; dummyot.undo_group = strings_table[4]; BLI_assert(ARRAY_SIZE(strings) == 5); |