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:
Christian Stenger
2024-12-11 08:25:34 +01:00
parent a952ab4dd7
commit e8383bc3b2

View File

@@ -644,6 +644,8 @@ FilePath BuildConfiguration::buildDirectoryFromTemplate(const FilePath &projectD
buildDir = buildDir.withNewPath(buildDir.path().replace(" ", "-"));
auto buildDevice = BuildDeviceKitAspect::device(kit);
if (!buildDevice)
return buildDir;
if (buildDir.isAbsolutePath())
return buildDevice->rootPath().withNewMappedPath(buildDir);