Skip to content

Commit 9d20d30

Browse files
committed
bugfix
1 parent c7dd77f commit 9d20d30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Datory/EnumExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ private static TAttribute GetEnumMemberAttribute<TAttribute>(this Enum value) wh
2424

2525
private static TAttribute GetEnumMemberAttribute<TAttribute>(this Type enumType, string enumMemberName)
2626
where TAttribute : Attribute =>
27-
enumType.GetMember(enumMemberName).Single().GetCustomAttribute<TAttribute>();
27+
enumType.GetMember(enumMemberName).FirstOrDefault().GetCustomAttribute<TAttribute>();
2828
}
2929
}

0 commit comments

Comments
 (0)