Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded nullability in event args #1901

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading