Skip to content

Commit e8383bc

Browse files
author
Christian Stenger
committed
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 <[email protected]>
1 parent a952ab4 commit e8383bc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/plugins/projectexplorer/buildconfiguration.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,8 @@ FilePath BuildConfiguration::buildDirectoryFromTemplate(const FilePath &projectD
644644
buildDir = buildDir.withNewPath(buildDir.path().replace(" ", "-"));
645645

646646
auto buildDevice = BuildDeviceKitAspect::device(kit);
647+
if (!buildDevice)
648+
return buildDir;
647649

648650
if (buildDir.isAbsolutePath())
649651
return buildDevice->rootPath().withNewMappedPath(buildDir);

0 commit comments

Comments
 (0)