Closed fvet closed 5 years ago
@fvet, this looks like a duplicate of #4422. It should have been fixed in the latest AL extension from the marketplace. Can you verify that the issue does not reproduce anymore?
I am closing this issue because it appears that it has been resolved. Please open a new issue if you believe this has not been resolved and reference the current issue.
Describe the bug
The CodeCop analyzer often results in following error:
Analyzer 'Microsoft.Dynamics.Nav.CodeCop.Design.Rule139DoNotAssignToStringWithSmallerCapacity' threw an exception of type 'System.NullReferenceException' with message 'System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Dynamics.Nav.CodeCop.Design.Rule139DoNotAssignToStringWithSmallerCapacity.CalculateStrSubstNoMethodResultLength(IInvocationExpression invocation, Boolean& isError) in C:\a\998\s\source\Prod\Microsoft.Dynamics.Nav.CodeCop\Design\Rule139DoNotAssignToStringWithSmallerCapacity.cs:line 279 at Microsoft.Dynamics.Nav.CodeCop.Design.Rule139DoNotAssignToStringWithSmallerCapacity.CalculateMaxExpressionLength(IOperation expression, Boolean& isError) in C:\a\998\s\source\Prod\Microsoft.Dynamics.Nav.CodeCop\Design\Rule139DoNotAssignToStringWithSmallerCapacity.cs:line 176 at Microsoft.Dynamics.Nav.CodeCop.Design.Rule139DoNotAssignToStringWithSmallerCapacity.AnalyzeConversion(OperationAnalysisContext ctx) in C:\a\998\s\source\Prod\Microsoft.Dynamics.Nav.CodeCop\Design\Rule139DoNotAssignToStringWithSmallerCapacity.cs:line 48 at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass53_1.b__1() in C:\a\998\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 766
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable`1 info) in C:\a\998\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 1080'
To Reproduce
Using AL vsix from Partner Preview 04