File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,6 +88,33 @@ public async Task StartNextMissionRunIfSystemIsAvailable(Robot robot)
8888 return ;
8989 }
9090
91+ if ( missionRun . Tasks . Count == 0 )
92+ {
93+ logger . LogWarning (
94+ "MissionRun {RobotName} was not started on robot {RobotId} as the mission has no tasks" ,
95+ missionRun . Id ,
96+ robot . Id
97+ ) ;
98+ try
99+ {
100+ await AbortMissionRun (
101+ missionRun ,
102+ $ "Mission run { missionRun . Id } aborted: Mission has no tasks"
103+ ) ;
104+ }
105+ catch ( RobotNotFoundException )
106+ {
107+ logger . LogError (
108+ "Failed to abort scheduled mission {missionRun.Id} for robot {RobotName} with Id {RobotId}" ,
109+ missionRun . Id ,
110+ robot . Name ,
111+ robot . Id
112+ ) ;
113+ }
114+ await StartNextMissionRunIfSystemIsAvailable ( robot ) ;
115+ return ;
116+ }
117+
91118 missionRun . Tasks = await exclusionAreaService . FilterOutExcludedMissionTasks (
92119 missionRun . Tasks ,
93120 missionRun . InstallationCode
You can’t perform that action at this time.
0 commit comments