Skip to content

Commit f862afc

Browse files
committed
fix(Application): Fixed the V1EventExtensions, which were not checking the event's extensions for null before enumerating
1 parent e8d7e91 commit f862afc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/Synapse.Application/Extensions/V1EventExtensions.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ public static CloudEvent AsCloudEvent(this V1Event e)
4141
ce.DataContentType = e.DataContentType;
4242
ce.DataSchema = e.DataSchema;
4343
ce.Data = e.Data;
44-
foreach(var extension in e.ExtensionAttributes)
44+
if(e.ExtensionAttributes != null)
4545
{
46-
ce.SetAttributeFromString(extension.Key, extension.Value?.ToString()!);
46+
foreach (var extension in e.ExtensionAttributes)
47+
{
48+
ce.SetAttributeFromString(extension.Key, extension.Value?.ToString()!);
49+
}
4750
}
4851
return ce;
4952
}

0 commit comments

Comments
 (0)