Skip to content

Commit

Permalink
Special-case no attributes in GetCustomAttributeData (#54405)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub authored Jun 21, 2021
1 parent 4f3364e commit 1ccd65f
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 1ccd65f

Please sign in to comment.