diff --git a/FoodsharingSiegen.Contracts/Helper/AttributeExtensions.cs b/FoodsharingSiegen.Contracts/Helper/AttributeExtensions.cs index 4e64ee4..e3f348f 100644 --- a/FoodsharingSiegen.Contracts/Helper/AttributeExtensions.cs +++ b/FoodsharingSiegen.Contracts/Helper/AttributeExtensions.cs @@ -34,6 +34,7 @@ namespace FoodsharingSiegen.Contracts.Helper { var type = enumVal.GetType(); var memInfo = type.GetMember(enumVal.ToString()); + if (memInfo.Length == 0) return null; var attributes = memInfo[0].GetCustomAttributes(typeof(T), false); return attributes.Length > 0 ? (T)attributes[0] : null; }