GenericProjectManager: Fix crash updating deployment data

Fixes: QTCREATORBUG-23501
Change-Id: Ia36fe567edf26c293a8db2446d1ee2344b96433e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2020-01-21 16:24:50 +01:00
parent c16e205a77
commit b59785c4b5

View File

@@ -546,10 +546,12 @@ void GenericProject::updateDeploymentData()
hasDeploymentData = QFileInfo::exists(deploymentFilePath.toString());
}
if (hasDeploymentData) {
DeploymentData deploymentData;
deploymentData.addFilesFromDeploymentFile(deploymentFilePath.toString(),
projectDirectory().toString());
activeTarget()->setDeploymentData(deploymentData);
if (activeTarget()) {
DeploymentData deploymentData;
deploymentData.addFilesFromDeploymentFile(deploymentFilePath.toString(),
projectDirectory().toString());
activeTarget()->setDeploymentData(deploymentData);
}
if (m_deployFileWatcher->files() != QStringList(deploymentFilePath.toString())) {
m_deployFileWatcher->removeFiles(m_deployFileWatcher->files());
m_deployFileWatcher->addFile(deploymentFilePath.toString(),