diff --git a/src/main/java/LanguageToolLanguageServer.java b/src/main/java/LanguageToolLanguageServer.java index 5c001d5f..fcbc031b 100644 --- a/src/main/java/LanguageToolLanguageServer.java +++ b/src/main/java/LanguageToolLanguageServer.java @@ -260,6 +260,11 @@ public CompletableFuture>> codeAction( VersionedTextDocumentIdentifier textDocument = new VersionedTextDocumentIdentifier( document.getUri(), document.getVersion()); Pair, AnnotatedText> validateResult = validateDocument(document); + + if (validateResult.getValue() == null) { + return CompletableFuture.completedFuture(Collections.emptyList()); + } + String text = document.getText(); String plainText = validateResult.getValue().getPlainText(); AnnotatedText inverseAnnotatedText = null;