Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-11-14 01:47:23 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-14 01:47:23 +0300
commitc1d29ea7835c0f2ebd20531dfe3996c6bbce6b58 (patch)
treed7854c52ba16975cb31910bfd5ad041b1ed71213 /source/blender/windowmanager/intern/wm_operator_type.c
parenta5a86f39212fb16c8310d8eca67ccecc4c6f7dd7 (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/windowmanager/intern/wm_operator_type.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operator_type.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operator_type.c b/source/blender/windowmanager/intern/wm_operator_type.c
index 25ca84f3d57..e9287d83a9a 100644
--- a/source/blender/windowmanager/intern/wm_operator_type.c
+++ b/source/blender/windowmanager/intern/wm_operator_type.c
@@ -116,6 +116,7 @@ void WM_operatortype_append(void (*opfunc)(wmOperatorType *))
if (ot->name == NULL) {
CLOG_ERROR(WM_LOG_OPERATORS, "Operator '%s' has no name property", ot->idname);
}
+ BLI_assert((ot->description == NULL) || (ot->description[0]));
/* XXX All ops should have a description but for now allow them not to. */
RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description : UNDOCUMENTED_OPERATOR_TIP);
@@ -134,6 +135,7 @@ void WM_operatortype_append_ptr(void (*opfunc)(wmOperatorType *, void *), void *
RNA_def_struct_translation_context(ot->srna, BLT_I18NCONTEXT_OPERATOR_DEFAULT);
ot->translation_context = BLT_I18NCONTEXT_OPERATOR_DEFAULT;
opfunc(ot, userdata);
+ BLI_assert((ot->description == NULL) || (ot->description[0]));
RNA_def_struct_ui_text(ot->srna, ot->name, ot->description ? ot->description : UNDOCUMENTED_OPERATOR_TIP);
RNA_def_struct_identifier(&BLENDER_RNA, ot->srna, ot->idname);