From 777a7c6e15280d1633c128b8c75b69b1d9f1ecbb Mon Sep 17 00:00:00 2001 From: Teo Voinea <58236992+tevoinea@users.noreply.github.com> Date: Fri, 6 May 2022 11:36:43 -0400 Subject: [PATCH] Fix new_files (#1903) * Fix new_files * fmt --- .../ApiService/onefuzzlib/NotificationOperations.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ApiService/ApiService/onefuzzlib/NotificationOperations.cs b/src/ApiService/ApiService/onefuzzlib/NotificationOperations.cs index 3a69e0d61..8bfcb3e4e 100644 --- a/src/ApiService/ApiService/onefuzzlib/NotificationOperations.cs +++ b/src/ApiService/ApiService/onefuzzlib/NotificationOperations.cs @@ -58,17 +58,18 @@ public class NotificationOperations : Orm, INotificationOperations } } - if (report == null) { - await _context.Events.SendEvent(new EventFileAdded(container, filename)); - } else if (report.Report != null) { + if (report?.Report != null) { var reportTask = await _context.TaskOperations.GetByJobIdAndTaskId(report.Report.JobId, report.Report.TaskId); var crashReportedEvent = new EventCrashReported(report.Report, container, filename, reportTask?.Config); await _context.Events.SendEvent(crashReportedEvent); - } else if (report.RegressionReport != null) { + } else if (report?.RegressionReport != null) { var reportTask = await GetRegressionReportTask(report.RegressionReport); var regressionEvent = new EventRegressionReported(report.RegressionReport, container, filename, reportTask?.Config); + await _context.Events.SendEvent(regressionEvent); + } else { + await _context.Events.SendEvent(new EventFileAdded(container, filename)); } }