diff --git a/src/lsp.cc b/src/lsp.cc index 6c6863e56..4cab87626 100644 --- a/src/lsp.cc +++ b/src/lsp.cc @@ -332,7 +332,11 @@ std::string lsDocumentUri::GetRawPath() const { } AbsolutePath lsDocumentUri::GetAbsolutePath() const { - return *NormalizePath(GetRawPath(), false /*ensure_exists*/); + optional normalized = NormalizePath(GetRawPath(), false /*ensure_exists*/); + if (!normalized) { + return AbsolutePath(); + } + return *normalized; } void Reflect(Writer& visitor, lsDocumentUri& value) {