Skip to content

Commit 1497343

Browse files
committed
-Protect against multiple attributes error
1 parent 569ca0b commit 1497343

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Src/Newtonsoft.Json/Utilities/ReflectionUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ public static T GetAttribute<T>(object attributeProvider, bool inherit) where T
666666
{
667667
T[] attributes = GetAttributes<T>(attributeProvider, inherit);
668668

669-
return (attributes != null) ? attributes.SingleOrDefault() : null;
669+
return (attributes != null) ? attributes.FirstOrDefault() : null;
670670
}
671671

672672
#if !(NETFX_CORE || PORTABLE)

0 commit comments

Comments
 (0)