From b6dfab804b7715eec92022805b7f5ced74400ff6 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 19 Jun 2018 11:04:47 +0200 Subject: [PATCH] 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 75afda1798ebea05be9be8c4c415dd910a8966c9 Task-number: QTCREATORBUG-20631 Change-Id: I22fa16d424ee5928c920663e9d01c791b964e873 Reviewed-by: Tobias Hunger Reviewed-by: Ivan Donchevskii --- src/plugins/projectexplorer/abstractprocessstep.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index baa79648c14..1e7f33bf658 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -28,6 +28,7 @@ #include "buildconfiguration.h" #include "buildstep.h" #include "project.h" +#include "target.h" #include "task.h" #include @@ -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())