diff --git a/backend/api/Services/MissionSchedulingService.cs b/backend/api/Services/MissionSchedulingService.cs index 210e7b0b..57487041 100644 --- a/backend/api/Services/MissionSchedulingService.cs +++ b/backend/api/Services/MissionSchedulingService.cs @@ -74,6 +74,12 @@ public async Task StartNextMissionRunIfSystemIsAvailable(Robot robot) return; } + if (missionRun.InspectionArea == null) + { + logger.LogWarning("Mission {MissionRunId} does not have an inspection area and was therefore not started", missionRun.Id); + return; + } + if (robot.CurrentInspectionArea == null && missionRun.InspectionArea != null) { await robotService.UpdateCurrentInspectionArea(robot.Id, missionRun.InspectionArea.Id);