diff --git a/src/Runner.Worker/ExecutionContext.cs b/src/Runner.Worker/ExecutionContext.cs index 5c1f057bfa5..9378358de27 100644 --- a/src/Runner.Worker/ExecutionContext.cs +++ b/src/Runner.Worker/ExecutionContext.cs @@ -676,17 +676,17 @@ public void AddIssue(Issue issue, ExecutionContextLogOptions logOptions) { case IssueType.Error: wellKnownTag = WellKnownTags.Error; - previousCountForIssueType = _record.ErrorCount; + previousCountForIssueType = _record.ErrorCount ??= 0; incrementIssueTypeCount = () => { _record.ErrorCount++; }; break; case IssueType.Warning: wellKnownTag = WellKnownTags.Warning; - previousCountForIssueType = _record.WarningCount; + previousCountForIssueType = _record.WarningCount ??= 0; incrementIssueTypeCount = () => { _record.WarningCount++; }; break; case IssueType.Notice: wellKnownTag = WellKnownTags.Notice; - previousCountForIssueType = _record.NoticeCount; + previousCountForIssueType = _record.NoticeCount ??= 0; incrementIssueTypeCount = () => { _record.NoticeCount++; }; break; }