From 0e7a592c3c16bfb77ca9410a49d00d416406bdec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 2 Oct 2018 15:28:14 +1000 Subject: WM: report error w/ unknown operator name --- source/blender/makesrna/intern/rna_workspace_api.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/makesrna/intern/rna_workspace_api.c b/source/blender/makesrna/intern/rna_workspace_api.c index aac38d05cd8..78e617450e8 100644 --- a/source/blender/makesrna/intern/rna_workspace_api.c +++ b/source/blender/makesrna/intern/rna_workspace_api.c @@ -117,6 +117,7 @@ static void rna_WorkspaceTool_refresh_from_context( static PointerRNA rna_WorkspaceTool_operator_properties( bToolRef *tref, + ReportList *reports, const char *idname) { wmOperatorType *ot = WM_operatortype_find(idname, true); @@ -126,6 +127,9 @@ static PointerRNA rna_WorkspaceTool_operator_properties( WM_toolsystem_ref_properties_ensure(tref, ot, &ptr); return ptr; } + else { + BKE_reportf(reports, RPT_ERROR, "Operator '%s' not found!", idname); + } return PointerRNA_NULL; } @@ -164,6 +168,7 @@ void RNA_api_workspace_tool(StructRNA *srna) /* Access tool operator options (optionally create). */ func = RNA_def_function(srna, "operator_properties", "rna_WorkspaceTool_operator_properties"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_string(func, "operator", NULL, 0, "", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); /* return */ -- cgit v1.2.3