From d3d5eadf2432ddc874eabbb2d2f56c4b9ff8830f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 14 Oct 2019 10:58:29 +0200 Subject: Fix assert in VS project generator We must check whether outputs or inputVars are non-empty before accessing them. This amends commit 68866b1a. Task-number: QTBUG-79178 Change-Id: Iecf6dc705bac9bef5133ae2e5ceeace5f859f175 Reviewed-by: Oliver Wolff --- qmake/generators/win32/msvc_vcproj.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qmake/generators') diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index df4876ace7..51d8002324 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1569,12 +1569,14 @@ void VcprojGenerator::initExtraCompilerOutputs() if (!outputVar.isEmpty() && otherFilters.contains(outputVar)) continue; - QString tmp_out = project->first(outputs.first().toKey()).toQString(); + QString tmp_out; + if (!outputs.isEmpty()) + tmp_out = project->first(outputs.first().toKey()).toQString(); if (project->values(ProKey(*it + ".CONFIG")).indexOf("combine") != -1) { // Combined output, only one file result extraCompile.addFile(Option::fixPathToTargetOS( replaceExtraCompilerVariables(tmp_out, QString(), QString(), NoShell), false)); - } else { + } else if (!inputVars.isEmpty()) { // One output file per input const ProStringList &tmp_in = project->values(inputVars.first().toKey()); for (int i = 0; i < tmp_in.count(); ++i) { -- cgit v1.2.3