forked from qt-creator/qt-creator
AutoTest: Fix possible crash
Do not access list items if there are none.
Amends 502ad9badb
.
Fixes: QTCREATORBUG-24421
Change-Id: I2982f675bba36eac98cb116acf64472a9f415977
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -151,7 +151,8 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
|
|||||||
if (buildTargets.size() > 1 ) // there are multiple executables with the same build target
|
if (buildTargets.size() > 1 ) // there are multiple executables with the same build target
|
||||||
return; // let the user decide which one to run
|
return; // let the user decide which one to run
|
||||||
|
|
||||||
const BuildTargetInfo targetInfo = buildTargets.first();
|
const BuildTargetInfo targetInfo = buildTargets.size() ? buildTargets.first()
|
||||||
|
: BuildTargetInfo();
|
||||||
|
|
||||||
// we might end up with an empty targetFilePath - e.g. when having a library we just link to
|
// we might end up with an empty targetFilePath - e.g. when having a library we just link to
|
||||||
// there would be no BuildTargetInfo that could match
|
// there would be no BuildTargetInfo that could match
|
||||||
|
Reference in New Issue
Block a user