forked from qt-creator/qt-creator
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:
@@ -427,6 +427,10 @@ QFuture<PluginDumper::DependencyInfo> PluginDumper::loadDependencies(const FileP
|
|||||||
|
|
||||||
Utils::onFinished(loadQmlTypeDescription(dependenciesPaths), const_cast<PluginDumper*>(this),
|
Utils::onFinished(loadQmlTypeDescription(dependenciesPaths), const_cast<PluginDumper*>(this),
|
||||||
[this, iface, visited](const QFuture<PluginDumper::QmlTypeDescription> &typesFuture) {
|
[this, iface, visited](const QFuture<PluginDumper::QmlTypeDescription> &typesFuture) {
|
||||||
|
if (typesFuture.resultCount() == 0 || typesFuture.isCanceled()) {
|
||||||
|
iface->reportCanceled();
|
||||||
|
return;
|
||||||
|
}
|
||||||
PluginDumper::QmlTypeDescription typesResult = typesFuture.result();
|
PluginDumper::QmlTypeDescription typesResult = typesFuture.result();
|
||||||
FilePaths newDependencies = FileUtils::toFilePathList(typesResult.dependencies);
|
FilePaths newDependencies = FileUtils::toFilePathList(typesResult.dependencies);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user