Fix crash of process steps in deploy configuration

If the step is in a deploy configuration, it doesn't have a direct
parent build configuration, so we need to get that from the active
target.
This is generally improved for BuildStep in master, but here we still
have to do that by hand.

Fix-up of 75afda1798

Task-number: QTCREATORBUG-20631
Change-Id: I22fa16d424ee5928c920663e9d01c791b964e873
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Eike Ziller
2018-06-19 11:04:47 +02:00
parent 8623a93998
commit b6dfab804b

View File

@@ -28,6 +28,7 @@
#include "buildconfiguration.h"
#include "buildstep.h"
#include "project.h"
#include "target.h"
#include "task.h"
#include <coreplugin/reaper.h>
@@ -306,7 +307,10 @@ void AbstractProcessStep::processReadyReadStdOutput()
if (!m_process)
return;
m_process->setReadChannel(QProcess::StandardOutput);
const bool utf8Output = buildConfiguration()->environment().hasKey("VSLANG");
BuildConfiguration *bc = buildConfiguration();
if (!bc)
bc = target()->activeBuildConfiguration();
const bool utf8Output = bc && bc->environment().hasKey("VSLANG");
while (m_process->canReadLine()) {
QString line = utf8Output ? QString::fromUtf8(m_process->readLine())