QbsProjectManager: Fix potential null pointer access

We retrieved the watcher result from the wrong pointer.

Fixes: QTCREATORBUG-23924
Change-Id: I876d8adc0aef011deb3f5827f3e50c43a8d92dfc
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2020-05-12 12:32:54 +02:00
parent 8e1169f4bf
commit 56a4865b2f

View File

@@ -480,7 +480,7 @@ void QbsBuildSystem::updateProjectNodes(const std::function<void ()> &continuati
m_treeCreationWatcher = new TreeCreationWatcher(this);
connect(m_treeCreationWatcher, &TreeCreationWatcher::finished, this,
[this, watcher = m_treeCreationWatcher, continuation] {
std::unique_ptr<QbsProjectNode> rootNode(m_treeCreationWatcher->result());
std::unique_ptr<QbsProjectNode> rootNode(watcher->result());
if (watcher != m_treeCreationWatcher) {
watcher->deleteLater();
return;