From 863dd132bdbc16bdeb818490a2e119fb102e6745 Mon Sep 17 00:00:00 2001 From: Paul Mcilreavy Date: Sat, 14 May 2022 11:29:27 +1000 Subject: [PATCH] Fix Topic validation. --- src/AzureEventGridSimulator/Domain/Entities/EventGridEvent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AzureEventGridSimulator/Domain/Entities/EventGridEvent.cs b/src/AzureEventGridSimulator/Domain/Entities/EventGridEvent.cs index a55a31e..32ab09a 100644 --- a/src/AzureEventGridSimulator/Domain/Entities/EventGridEvent.cs +++ b/src/AzureEventGridSimulator/Domain/Entities/EventGridEvent.cs @@ -108,7 +108,7 @@ public void Validate() InvalidOperationException($"Property '{nameof(MetadataVersion)}' was found to be set to '{MetadataVersion}', but was expected to either be null or be set to 1."); } - if (Topic != null) + if (!string.IsNullOrEmpty(Topic)) { throw new InvalidOperationException($"Property '{nameof(Topic)}' was found to be set to '{Topic}', but was expected to either be null/empty."); }