diff --git a/VisualCard/Parsers/VcardParser.cs b/VisualCard/Parsers/VcardParser.cs index 56d4cff..cf0a859 100644 --- a/VisualCard/Parsers/VcardParser.cs +++ b/VisualCard/Parsers/VcardParser.cs @@ -195,6 +195,11 @@ internal void ValidateCard(Card card) string[] expectedFields = [.. expectedFieldList]; if (!ValidateComponent(ref expectedFields, out string[] actualFields, card)) throw new InvalidDataException($"The following keys [{string.Join(", ", expectedFields)}] are required. Got [{string.Join(", ", actualFields)}]."); + + // Check for organization vCards that may not have MEMBER properties + string[] forbiddenOrgFields = [VcardConstants._memberSpecifier]; + if (card.CardKind != CardKind.Group && ValidateComponent(ref forbiddenOrgFields, out _, card)) + throw new InvalidDataException($"{card.CardKind} vCards are forbidden from having MEMBER properties."); } private bool ValidateComponent(ref string[] expectedFields, out string[] actualFields, TComponent component)