forked from qt-creator/qt-creator
Fix crash when project node is not found
Change-Id: I235fecb579023530692742f14474ae5229237c28 Fixes: QTCREATORBUG-22564 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
committed by
BogDan Vatra
parent
e00536eeea
commit
30e863b676
@@ -234,15 +234,15 @@ bool AndroidDeployQtStep::init()
|
|||||||
|
|
||||||
if (m_useAndroiddeployqt) {
|
if (m_useAndroiddeployqt) {
|
||||||
const ProjectNode *node = target()->project()->findNodeForBuildKey(rc->buildKey());
|
const ProjectNode *node = target()->project()->findNodeForBuildKey(rc->buildKey());
|
||||||
|
if (!node)
|
||||||
|
return false;
|
||||||
m_apkPath = Utils::FilePath::fromString(node->data(Constants::AndroidApk).toString());
|
m_apkPath = Utils::FilePath::fromString(node->data(Constants::AndroidApk).toString());
|
||||||
if (!m_apkPath.isEmpty()) {
|
if (!m_apkPath.isEmpty()) {
|
||||||
m_manifestName = Utils::FilePath::fromString(node->data(Constants::AndroidManifest).toString());
|
m_manifestName = Utils::FilePath::fromString(node->data(Constants::AndroidManifest).toString());
|
||||||
m_command = AndroidConfigurations::currentConfig().adbToolPath();
|
m_command = AndroidConfigurations::currentConfig().adbToolPath();
|
||||||
AndroidManager::setManifestPath(target(), m_manifestName);
|
AndroidManager::setManifestPath(target(), m_manifestName);
|
||||||
} else {
|
} else {
|
||||||
QString jsonFile;
|
QString jsonFile = node->data(Constants::AndroidDeploySettingsFile).toString();
|
||||||
if (node)
|
|
||||||
jsonFile = node->data(Constants::AndroidDeploySettingsFile).toString();
|
|
||||||
if (jsonFile.isEmpty()) {
|
if (jsonFile.isEmpty()) {
|
||||||
emit addOutput(tr("Cannot find the androiddeploy Json file."), OutputFormat::Stderr);
|
emit addOutput(tr("Cannot find the androiddeploy Json file."), OutputFormat::Stderr);
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user