Closed ThomasBrendel closed 4 years ago
Thanks for reporting this issue, Thomas! I have forwarded it to the team that implemented the rule.
Hi @ThomasBrendel,
Is the error comming from the code you listed or from the app.json file?
Can you give us more of the call stack?
Thanks /Marc
Hello,
the Error is from the code i have listed. Its because you have
ModifiedMsg + UpdateMsg
and you have only %1 parameter inside the Textmsg and combine that textmessage inside the SUBSTRNO.
If you combine both texts outside the function then all is fine. The Problem is that you have to seriously search, because the warningmessage shows only app.json, instead the position of the real problem (if that is a problem at all)
Thanks
Can you send more of the stack trace?
{
"resource": "/c:/Users/tbrendel/Documents/AL/M365ConnectorJobStructureEditor/app.json",
"owner": "_generated_diagnostic_collectionname#1",
"code": "AD0001",
"severity": 4,
"message": "Analyzer 'Microsoft.Dynamics.Nav.CodeCop.Design.Rule131StringParamsMustMatchPlaceholders' threw an exception of type 'System.NullReferenceException' with message 'System.NullReferenceException: Object reference not set to an instance of an object.\r\n at Microsoft.Dynamics.Nav.CodeCop.Design.Rule131StringParamsMustMatchPlaceholders.GetExpressionParamValue(IOperation expression) in F:\a\193\s\source\Prod\Microsoft.Dynamics.Nav.CodeCop\Design\Rule131StringParamsMustMatchPlaceholders.cs:line 105\r\n at Microsoft.Dynamics.Nav.CodeCop.Design.Rule131StringParamsMustMatchPlaceholders.AnalyzeInvocation(OperationAnalysisContext ctx) in F:\a\193\s\source\Prod\Microsoft.Dynamics.Nav.CodeCop\Design\Rule131StringParamsMustMatchPlaceholders.cs:line 75\r\n at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass53_1.
Fixed in master
Hello Team,
we found a strange Analyzer Error when having following code:
var ModifiedMsg: label 'You have modified %1.\'; UpdateMsg: label 'Do you want to update the lines?'
Question := StrSubstNo( ModifiedMsg + UpdateMsg, ChangedFieldName);
The CodeCop comes up with such a message:
You have no chance to find it in your code