StefanMaron / BusinessCentral.LinterCop

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

Rule0024SemicolonAfterMethodOrTriggerDeclaration - System.NullReferenceException #775

Open a-gnius opened 1 month ago

a-gnius commented 1 month ago

Do you have any thoughts on what is causing the issue?

Analyzer 'BusinessCentral.LinterCop.Design.Rule0024SemicolonAfterMethodOrTriggerDeclaration' threw an exception of type 'System.NullReferenceException' with message 'System.NullReferenceException: Object reference not set to an instance of an object.
   at BusinessCentral.LinterCop.Design.Rule0024SemicolonAfterMethodOrTriggerDeclaration.AnalyzeSemicolonAfterMethodOrTriggerDeclaration(SyntaxNodeAnalysisContext ctx)
   at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass53_1.<ExecuteSyntaxNodeAction>b__1() in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 752
   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 1095'
Arthurvdv commented 1 month ago

I've added additional error handling to this rule in the (pre-release) version v0.31.2 of LinterCop.
Could you switch to the pre-release version of the LinterCop and verify if it resolves the issue?