StefanMaron / BusinessCentral.LinterCop

Community driven code linter for AL (MS Dynamics 365 Business Central)
https://stefanmaron.com
MIT License
68 stars 27 forks source link

[Preview ] LC0005 - System.NullReferenceException [v14.0.1010940 (pre-release)] #634

Closed pri-kise closed 1 week ago

pri-kise commented 1 month ago

I receive the following error attached to the app.json

Analyzer 'BusinessCentral.LinterCop.Design.Rule0005VariableCasingShouldNotDifferFromDeclaration' 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.CodeAnalysis.BinderFactory.BinderFactoryVisitor.VisitCore(SyntaxNode node) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\BinderFactory.cs:line 327
   at Microsoft.Dynamics.Nav.CodeAnalysis.SyntaxVisitor`1.VisitPragmaWarningDirectiveTrivia(PragmaWarningDirectiveTriviaSyntax node) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Generated\SyntaxVisitor.Generated.cs:line 1665
   at Microsoft.Dynamics.Nav.CodeAnalysis.Syntax.PragmaWarningDirectiveTriviaSyntax.Accept[TResult](SyntaxVisitor`1 visitor) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Generated\SyntaxNodes.Generated.cs:line 31400
   at Microsoft.Dynamics.Nav.CodeAnalysis.BinderFactory.GetBinder(SyntaxNode node, Int32 position) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\BinderFactory.cs:line 81
   at Microsoft.Dynamics.Nav.CodeAnalysis.Compilation.GetBinder(SyntaxNode syntax) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\Compilation.cs:line 1530
   at Microsoft.Dynamics.Nav.CodeAnalysis.ReportDataItemSemanticModel.GetSymbolInfoWorker(SyntaxNode node, CancellationToken cancellationToken) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\ReportDataItemSemanticModel.cs:line 96
   at Microsoft.Dynamics.Nav.CodeAnalysis.SyntaxTreeSemanticModel.GetSymbolInfoWorker(SyntaxNode node, CancellationToken cancellationToken) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\SyntaxTreeSemanticModel.cs:line 95
   at Microsoft.Dynamics.Nav.CodeAnalysis.SemanticModel.GetSymbolInfo(ExpressionSyntax expression, CancellationToken cancellationToken) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\SemanticModel.cs:line 551
   at Microsoft.Dynamics.Nav.CodeAnalysis.SemanticModel.GetSymbolInfoFromNode(SyntaxNode node, CancellationToken cancellationToken) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\SemanticModel.cs:line 409
   at Microsoft.Dynamics.Nav.CodeAnalysis.SemanticModel.GetSymbolInfoCore(SyntaxNode node, CancellationToken cancellationToken) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\SemanticModel.cs:line 397
   at Microsoft.Dynamics.Nav.CodeAnalysis.SemanticModel.GetSymbolInfo(SyntaxNode node, CancellationToken cancellationToken) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\SemanticModel.cs:line 96
   at BusinessCentral.LinterCop.Design.Rule0005VariableCasingShouldNotDifferFromDeclaration.AnalyzeIdentifierName(SyntaxNodeAnalysisContext ctx)
   at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable`1 info) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 1088'
Arthurvdv commented 1 month ago

I've had an repo with a collegae today with the same error message.

I think I've resolved this now with the new v0.30.22 version of the LinterCop.