forked from qt-creator/qt-creator
PE: Fix possible crash
In case of an invalid device we may crash when trying to generate a build directory path. Prevent this by leaving earlier. Change-Id: Ieb02abd98467693d38df6dde434e2a6962e4d137 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -644,6 +644,8 @@ FilePath BuildConfiguration::buildDirectoryFromTemplate(const FilePath &projectD
|
|||||||
buildDir = buildDir.withNewPath(buildDir.path().replace(" ", "-"));
|
buildDir = buildDir.withNewPath(buildDir.path().replace(" ", "-"));
|
||||||
|
|
||||||
auto buildDevice = BuildDeviceKitAspect::device(kit);
|
auto buildDevice = BuildDeviceKitAspect::device(kit);
|
||||||
|
if (!buildDevice)
|
||||||
|
return buildDir;
|
||||||
|
|
||||||
if (buildDir.isAbsolutePath())
|
if (buildDir.isAbsolutePath())
|
||||||
return buildDevice->rootPath().withNewMappedPath(buildDir);
|
return buildDevice->rootPath().withNewMappedPath(buildDir);
|
||||||
|
Reference in New Issue
Block a user