Skip to content

Commit

Permalink
Remove unneeded nullability in event args
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Dec 18, 2024
1 parent 5c97282 commit 358ee8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions backend/api/EventHandlers/MissionEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions backend/api/Services/Events/MissionEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 358ee8c

Please sign in to comment.