LanguageClient: avoid optional::value

Potentially throws std::bad_optional_access. Use operator* and
operator-> instead.

Change-Id: Idefa137da53f3663ea88961f1105b93402ec4777
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
David Schulz
2022-02-24 09:38:59 +01:00
parent 41538832c3
commit 4452f71201
21 changed files with 110 additions and 121 deletions

View File

@@ -117,7 +117,7 @@ void DocumentSymbolCache::handleResponse(const DocumentUri &uri,
m_runningRequests.remove(uri);
if (Utils::optional<DocumentSymbolsRequest::Response::Error> error = response.error()) {
if (m_client)
m_client->log(error.value());
m_client->log(*error);
}
const DocumentSymbolsResult &symbols = response.result().value_or(DocumentSymbolsResult());
m_cache[uri] = symbols;