diff options
| -rw-r--r-- | clang-tools-extra/clangd/ClangdServer.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp index 6bdd082cd5b..7f0b29d2476 100644 --- a/clang-tools-extra/clangd/ClangdServer.cpp +++ b/clang-tools-extra/clangd/ClangdServer.cpp @@ -191,11 +191,10 @@ TaskHandle ClangdServer::codeComplete(PathRef File, Position Pos, auto Task = [PCHs, Pos, FS, CodeCompleteOpts, this](Path File, Callback<CodeCompleteResult> CB, llvm::Expected<InputsAndPreamble> IP) { - if (isCancelled()) - return CB(llvm::make_error<CancelledError>()); - if (!IP) return CB(IP.takeError()); + if (isCancelled()) + return CB(llvm::make_error<CancelledError>()); auto PreambleData = IP->Preamble; |

