From 30e863b676741740502e679bd05aec348955c6ee Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Sat, 15 Jun 2019 10:12:31 +0300 Subject: Fix crash when project node is not found Change-Id: I235fecb579023530692742f14474ae5229237c28 Fixes: QTCREATORBUG-22564 Reviewed-by: hjk --- src/plugins/android/androiddeployqtstep.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/android') diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index 7994c85b6a..42a3c7d6e0 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -234,15 +234,15 @@ bool AndroidDeployQtStep::init() if (m_useAndroiddeployqt) { const ProjectNode *node = target()->project()->findNodeForBuildKey(rc->buildKey()); + if (!node) + return false; m_apkPath = Utils::FilePath::fromString(node->data(Constants::AndroidApk).toString()); if (!m_apkPath.isEmpty()) { m_manifestName = Utils::FilePath::fromString(node->data(Constants::AndroidManifest).toString()); m_command = AndroidConfigurations::currentConfig().adbToolPath(); AndroidManager::setManifestPath(target(), m_manifestName); } else { - QString jsonFile; - if (node) - jsonFile = node->data(Constants::AndroidDeploySettingsFile).toString(); + QString jsonFile = node->data(Constants::AndroidDeploySettingsFile).toString(); if (jsonFile.isEmpty()) { emit addOutput(tr("Cannot find the androiddeploy Json file."), OutputFormat::Stderr); return false; -- cgit v1.2.1