Skip to content

Commit 9406664

Browse files
authored
Merge pull request #150 from credfeto/bugfix/149-index-out-of-range-creating-event-id
#149 - Fixed index out of range issue with negative ids
2 parents 04038d0 + fb572f8 commit 9406664

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLogger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ internal static LogEventProperty CreateEventIdProperty(EventId eventId)
139139

140140
if (eventId.Id != 0)
141141
{
142-
if (eventId.Id < LowEventIdValues.Length)
142+
if (eventId.Id >= 0 && eventId.Id < LowEventIdValues.Length)
143143
// Avoid some allocations
144144
properties.Add(LowEventIdValues[eventId.Id]);
145145
else

0 commit comments

Comments
 (0)