diff --git a/backend/api/EventHandlers/MissionEventHandler.cs b/backend/api/EventHandlers/MissionEventHandler.cs index 9a19a3535..2dfecd427 100644 --- a/backend/api/EventHandlers/MissionEventHandler.cs +++ b/backend/api/EventHandlers/MissionEventHandler.cs @@ -114,7 +114,7 @@ private async void OnSendRobotToDockTriggered(object? sender, RobotEmergencyEven return; } - try { await RobotService.UpdateFlotillaStatus(e.RobotId, e.RobotFlotillaStatus ?? RobotFlotillaStatus.Normal); } + try { await RobotService.UpdateFlotillaStatus(e.RobotId, e.RobotFlotillaStatus); } catch (Exception ex) { _logger.LogError("Was not able to update Robot Flotilla status for robot {RobotId}, {ErrorMessage}", e.RobotId, ex.Message); @@ -179,7 +179,7 @@ private async void OnReleaseRobotFromDockTriggered(object? sender, RobotEmergenc robot.MissionQueueFrozen = false; - try { await RobotService.UpdateFlotillaStatus(e.RobotId, e.RobotFlotillaStatus ?? RobotFlotillaStatus.Normal); } + try { await RobotService.UpdateFlotillaStatus(e.RobotId, e.RobotFlotillaStatus); } catch (Exception ex) { _logger.LogError("Was not able to update Robot Flotilla status for robot {RobotId}, {ErrorMessage}", e.RobotId, ex.Message); diff --git a/backend/api/Services/Events/MissionEventArgs.cs b/backend/api/Services/Events/MissionEventArgs.cs index 6f72ad3db..14e59c01f 100644 --- a/backend/api/Services/Events/MissionEventArgs.cs +++ b/backend/api/Services/Events/MissionEventArgs.cs @@ -12,10 +12,10 @@ public class RobotAvailableEventArgs(string robotId) : EventArgs public string RobotId { get; } = robotId; } - public class RobotEmergencyEventArgs(string robotId, RobotFlotillaStatus? robotFlotillaStatus = null) : EventArgs + public class RobotEmergencyEventArgs(string robotId, RobotFlotillaStatus robotFlotillaStatus) : EventArgs { public string RobotId { get; } = robotId; - public RobotFlotillaStatus? RobotFlotillaStatus { get; } = robotFlotillaStatus; + public RobotFlotillaStatus RobotFlotillaStatus { get; } = robotFlotillaStatus; } public class TeamsMessageEventArgs(string teamsMessage) : EventArgs