Skip to content

Commit

Permalink
Fix analyzer crash for MemberData analysis without arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed Feb 7, 2025
1 parent 9004f22 commit e6c18a1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ public IEnumerable<ITypeSymbol> FindTypeArguments(
string name,
AttributeData memberDataAttribute)
{
var arguments = memberDataAttribute.ConstructorArguments[1].Values;
var arguments =
memberDataAttribute.ConstructorArguments.Length > 1
? memberDataAttribute.ConstructorArguments[1].Values
: ImmutableArray<TypedConstant>.Empty;
var method = GetCompatibleMethod(type, name, arguments);

if (method is not null && method.IsStatic)
Expand Down

0 comments on commit e6c18a1

Please sign in to comment.