From 4d4ccb51a3f717227f90590bcf543087199bbf01 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 18 Sep 2024 09:37:39 +0200 Subject: [PATCH] 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 --- src/plugins/android/androidrunnerworker.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 353a7d39a02..e5b68ef975b 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -875,7 +875,10 @@ ExecutableItem runnerRecipe(const Storage &glueStorage) const Storage storage; const auto onSetup = [glueStorage, storage] { + if (glueStorage->runControl()->target() == nullptr) + return SetupResult::StopWithError; setupStorage(storage.activeStorage(), glueStorage.activeStorage()); + return SetupResult::Continue; }; return Group {