Skip to content

Commit

Permalink
Special-case no attributes in GetCustomAttributeData
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Jun 21, 2021
1 parent f891033 commit 2da10f5
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ private static CustomAttributeType InitCustomAttributeType(RuntimeType parameter
private static IList<CustomAttributeData> GetCustomAttributes(RuntimeModule module, int tkTarget)
{
CustomAttributeRecord[] records = GetCustomAttributeRecords(module, tkTarget);
if (records.Length == 0)
{
return Array.Empty<CustomAttributeData>();
}

CustomAttributeData[] customAttributes = new CustomAttributeData[records.Length];
for (int i = 0; i < records.Length; i++)
Expand Down

0 comments on commit 2da10f5

Please sign in to comment.