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 <oliver.wolff@qt.io>
This commit is contained in:
Joerg Bornemann 2019-10-14 10:58:29 +02:00
parent ba328d2c7b
commit d3d5eadf24

View File

@ -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) {