[Harness] Ensure we do not throw an exception if we do not have tasks. (#8272)
The First extension will throw an exception if the list is empty. Use FirstOrDefault, check if the devices are null and return the test as Ignored. fixes: https://github.com/xamarin/xamarin-macios/issues/8271
This commit is contained in:
Родитель
f8001a8114
Коммит
3004e7d34b
|
@ -63,7 +63,11 @@ namespace Xharness.Jenkins.TestTasks {
|
|||
await task.SelectSimulatorAsync ();
|
||||
}
|
||||
|
||||
var devices = executingTasks.First ().Simulators;
|
||||
var devices = executingTasks.FirstOrDefault ()?.Simulators;
|
||||
if (devices == null) {
|
||||
ExecutionResult = TestExecutingResult.DeviceNotFound;
|
||||
return;
|
||||
}
|
||||
Jenkins.MainLog.WriteLine ("Selected simulator: {0}", devices.Length > 0 ? devices [0].Name : "none");
|
||||
|
||||
foreach (var dev in devices)
|
||||
|
|
Загрузка…
Ссылка в новой задаче