Clang: Check that follow symbol QFuture is not cancelled

We can't take QFuture result if it's cancelled.

Change-Id: I493e083c0d35e753d1b2616caf2081f472393e34
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-03-20 10:29:55 +01:00
parent ddeb8df894
commit f67df4f9ab

View File

@@ -129,6 +129,8 @@ void ClangFollowSymbol::findLink(const CppTools::CursorInEditor &data,
QObject::connect(&m_watcher, &FutureSymbolWatcher::finished,
[=, watcher=&m_watcher, callback=std::move(processLinkCallback)]() mutable {
if (watcher->isCanceled())
return callback(Utils::Link());
CppTools::SymbolInfo result = watcher->result();
// We did not fail but the result is empty
if (result.fileName.isEmpty()) {