Android: Ensure the target is not nullptr

It might happen that runnerRecipe() is executed after the
avdRecipe, so slightly delayed. In meantime the shutdown
could have started and a queued call to stop() was scheduled
by the RunControl. In this case it may happen that before
the runnerRecipe() starts before the stop() is executed.
Guard the target inside runnerRecipe() and stop with error
when it's nullptr.

Change-Id: I3da15a14e0d555e851bdb2bbc053973c31cba308
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Jarek Kobus
2024-09-18 09:37:39 +02:00
parent fdb37a8aa4
commit 4d4ccb51a3

View File

@@ -875,7 +875,10 @@ ExecutableItem runnerRecipe(const Storage<RunnerInterface> &glueStorage)
const Storage<RunnerStorage> storage;
const auto onSetup = [glueStorage, storage] {
if (glueStorage->runControl()->target() == nullptr)
return SetupResult::StopWithError;
setupStorage(storage.activeStorage(), glueStorage.activeStorage());
return SetupResult::Continue;
};
return Group {