QmlJSPluginDumper: Prevent potential crash when no results in QFuture

Ensure we don't reference non-existing QFuture's result.

Change-Id: I57668390e6ca83ae30c0b1de3e3a083a344ddbaa
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2024-02-15 15:57:56 +01:00
parent 894eaf9c06
commit 3e7ef867dd

View File

@@ -427,6 +427,10 @@ QFuture<PluginDumper::DependencyInfo> PluginDumper::loadDependencies(const FileP
Utils::onFinished(loadQmlTypeDescription(dependenciesPaths), const_cast<PluginDumper*>(this),
[this, iface, visited](const QFuture<PluginDumper::QmlTypeDescription> &typesFuture) {
if (typesFuture.resultCount() == 0 || typesFuture.isCanceled()) {
iface->reportCanceled();
return;
}
PluginDumper::QmlTypeDescription typesResult = typesFuture.result();
FilePaths newDependencies = FileUtils::toFilePathList(typesResult.dependencies);