summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/buffer.c b/buffer.c
index b4c85d5..13d3310 100644
--- a/buffer.c
+++ b/buffer.c
@@ -1430,7 +1430,7 @@ static Status buffer_insert_lines(TextBuffer *buffer, u32 where, u32 number) {
LSPDocumentID buffer_lsp_document_id(TextBuffer *buffer) {
LSP *lsp = buffer_lsp(buffer);
- return lsp_document_id(lsp, buffer->filename);
+ return lsp ? lsp_document_id(lsp, buffer->filename) : 0;
}
// LSP uses UTF-16 indices because Microsoft fucking loves UTF-16 and won't let it die