diff --git a/BepInEx.Analyzers/BepInEx.Analyzers/AccessPublicizedMemberAnalyzer.cs b/BepInEx.Analyzers/BepInEx.Analyzers/AccessPublicizedMemberAnalyzer.cs index 97087d1..061d2e4 100644 --- a/BepInEx.Analyzers/BepInEx.Analyzers/AccessPublicizedMemberAnalyzer.cs +++ b/BepInEx.Analyzers/BepInEx.Analyzers/AccessPublicizedMemberAnalyzer.cs @@ -53,7 +53,7 @@ private void AnalyzeSimpleMemberAccess(SyntaxNodeAnalysisContext context) { var memberAccess = (MemberAccessExpressionSyntax)context.Node; var symbol = context.SemanticModel.GetSymbolInfo(memberAccess.Name, context.CancellationToken).Symbol; - + if (symbol == null) return; @@ -62,12 +62,12 @@ private void AnalyzeSimpleMemberAccess(SyntaxNodeAnalysisContext context) var propertyUsage = context.Node.GetPropertyUsage(); if (propertyUsage == Extensions.PropertyUsage.Get || propertyUsage == Extensions.PropertyUsage.GetAndSet) { - var getMethodPublicizedAttribute = propertySymbol.GetMethod.GetAttribute(PublicizedAttributeName); + var getMethodPublicizedAttribute = propertySymbol.GetMethod?.GetAttribute(PublicizedAttributeName); Check(getMethodPublicizedAttribute, symbol, context, memberAccess); } else { - var setMethodPublicizedAttribute = propertySymbol.SetMethod.GetAttribute(PublicizedAttributeName); + var setMethodPublicizedAttribute = propertySymbol.SetMethod?.GetAttribute(PublicizedAttributeName); Check(setMethodPublicizedAttribute, symbol, context, memberAccess); } }