WebAssembly: Prevent null pointer access

The detector.device can be nullptr

Amends: cacc4aeede

Change-Id: I5b9b6aa722c8e6e8a96d05cdf2f1b214735db858
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2023-05-17 17:24:28 +02:00
parent 7057962e44
commit caad8074de

View File

@@ -96,7 +96,8 @@ static Toolchains doAutoDetect(const ToolchainDetector &detector)
if (!WebAssemblyEmSdk::isValid(sdk))
return {};
if (detector.device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
if (detector.device
&& detector.device->type() != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
// Only detect toolchains from the emsdk installation device
const FilePath deviceRoot = detector.device->rootPath();
if (deviceRoot.host() != sdk.host())