Skip to content

Commit

Permalink
Merge pull request #782 from StefanMaron/ResolveNullReferenceException
Browse files Browse the repository at this point in the history
Resolve NullReferenceException on Rule0024
  • Loading branch information
Arthurvdv authored Oct 7, 2024
2 parents 84d6c4c + 544f812 commit 44d7f7e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#nullable disable // TODO: Enable nullable and review rule
using BusinessCentral.LinterCop.AnalysisContextExtension;
using BusinessCentral.LinterCop.AnalysisContextExtension;
using Microsoft.Dynamics.Nav.CodeAnalysis;
using Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics;
using Microsoft.Dynamics.Nav.CodeAnalysis.Syntax;
Expand All @@ -16,10 +15,11 @@ public class Rule0024SemicolonAfterMethodOrTriggerDeclaration : DiagnosticAnalyz

private void AnalyzeSemicolonAfterMethodOrTriggerDeclaration(SyntaxNodeAnalysisContext ctx)
{
if (ctx.IsObsoletePendingOrRemoved()) return;
if (ctx.IsObsoletePendingOrRemoved())
return;

MethodOrTriggerDeclarationSyntax syntax = ctx.Node as MethodOrTriggerDeclarationSyntax;
if (syntax == null) return;
if (ctx.Node is not MethodOrTriggerDeclarationSyntax syntax)
return;

if (syntax.SemicolonToken.Kind != SyntaxKind.None)
{
Expand Down

0 comments on commit 44d7f7e

Please sign in to comment.