aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2022-10-20 22:47:02 +0200
committerAlessandro Portale <alessandro.portale@qt.io>2022-10-21 11:12:41 +0000
commitacfd71831cdea3f9177ee86ed1b5f7f9c7e2aa29 (patch)
tree58413b497dbecb060312821ae96254ce83010c91
parentf496970002e2374d5405be28a79cfcacd0443897 (diff)
Android: Fix crash in AndroidDeployQtStep
info.cpuAbi in AndroidDeployQtStep::init can be empty, for example when opening a configured project with a different Qt Creator version, and the "No valid settings file could be found." message appears. Check for !empty(), before accessing the first item. Fixes: QTCREATORBUG-27795 Change-Id: Ife0bf495ed8ea7bfb342300ee2e457398c8ee8f2 Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/plugins/android/androiddeployqtstep.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp
index beeb851118..e676c457c5 100644
--- a/src/plugins/android/androiddeployqtstep.cpp
+++ b/src/plugins/android/androiddeployqtstep.cpp
@@ -201,7 +201,8 @@ bool AndroidDeployQtStep::init()
}
const QtSupport::QtVersion * const qt = QtSupport::QtKitAspect::qtVersion(kit());
- if (qt && qt->supportsMultipleQtAbis() && !selectedAbis.contains(info.cpuAbi.first())) {
+ if (qt && qt->supportsMultipleQtAbis() && !info.cpuAbi.isEmpty() &&
+ !selectedAbis.contains(info.cpuAbi.first())) {
TaskHub::addTask(DeploymentTask(Task::Warning,
tr("Android: The main ABI of the deployment device (%1) is not selected. The app "
"execution or debugging might not work properly. Add it from Projects > Build > "