forked from qt-creator/qt-creator
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:
@@ -96,7 +96,8 @@ static Toolchains doAutoDetect(const ToolchainDetector &detector)
|
|||||||
if (!WebAssemblyEmSdk::isValid(sdk))
|
if (!WebAssemblyEmSdk::isValid(sdk))
|
||||||
return {};
|
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
|
// Only detect toolchains from the emsdk installation device
|
||||||
const FilePath deviceRoot = detector.device->rootPath();
|
const FilePath deviceRoot = detector.device->rootPath();
|
||||||
if (deviceRoot.host() != sdk.host())
|
if (deviceRoot.host() != sdk.host())
|
||||||
|
Reference in New Issue
Block a user