diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index fd814163a72..a36caf3befc 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -857,7 +857,10 @@ void TextEditorWidgetFind::selectAll(const QString &txt, FindFlags findFlags) m_selectWatcher = new QFutureWatcher(); connect(m_selectWatcher, &QFutureWatcher::finished, this, [this]() { - const FileSearchResultList &results = m_selectWatcher->result(); + const QFuture future = m_selectWatcher->future(); + if (future.resultCount() <= 0) + return; + const FileSearchResultList &results = future.result(); const QTextCursor c(m_editor->document()); auto cursorForResult = [c](const FileSearchResult &r) { return Utils::Text::selectAt(c, r.lineNumber, r.matchStart + 1, r.matchLength);