summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2023-05-17 17:24:28 +0200
committerAlessandro Portale <alessandro.portale@qt.io>2023-05-17 15:37:16 +0000
commitcaad8074de37db4eccfa9daf392cf1d7f70ff70d (patch)
tree3c3e6467c477245ff65a4b8a75944abde33a163d
parent7057962e445a6c5e01af2198fc7547dada0439ed (diff)
downloadqt-creator-master.tar.gz
WebAssembly: Prevent null pointer accessHEADmaster
The detector.device can be nullptr Amends: cacc4aeede245ddc92a196e99fb1e66458d4403c Change-Id: I5b9b6aa722c8e6e8a96d05cdf2f1b214735db858 Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/plugins/webassembly/webassemblytoolchain.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/webassembly/webassemblytoolchain.cpp b/src/plugins/webassembly/webassemblytoolchain.cpp
index 4ee3eff591..c413f27566 100644
--- a/src/plugins/webassembly/webassemblytoolchain.cpp
+++ b/src/plugins/webassembly/webassemblytoolchain.cpp
@@ -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())