Skip to content

Commit

Permalink
Fix NullPointerException in codeAction
Browse files Browse the repository at this point in the history
Fixes #1.
  • Loading branch information
valentjn committed Sep 16, 2019
1 parent 6cbd92e commit 557de84
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/LanguageToolLanguageServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ public CompletableFuture<List<Either<Command, CodeAction>>> codeAction(
VersionedTextDocumentIdentifier textDocument = new VersionedTextDocumentIdentifier(
document.getUri(), document.getVersion());
Pair<List<RuleMatch>, 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;
Expand Down

0 comments on commit 557de84

Please sign in to comment.