Skip to content

Commit

Permalink
Add null check for data field in completionItem/resolve request
Browse files Browse the repository at this point in the history
Signed-off-by: Jessica He <[email protected]>
  • Loading branch information
JessicaJHee committed Jul 18, 2023
1 parent 3dc0325 commit 6a9eff5
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,13 @@ public CompletableFuture<Either<List<CompletionItem>, CompletionList>> completio

@Override
public CompletableFuture<CompletionItem> resolveCompletionItem(CompletionItem unresolved) {
String uri = CompletionData.getCompletionData(unresolved).getUri();
TextDocumentService service = getTextDocumentService(new TextDocumentIdentifier(uri));
if (service != null) {
return service.resolveCompletionItem(unresolved);
CompletionData data = CompletionData.getCompletionData(unresolved);
if (data != null) {
String uri = data.getUri();
TextDocumentService service = getTextDocumentService(new TextDocumentIdentifier(uri));
if (service != null) {
return service.resolveCompletionItem(unresolved);
}
}
return CompletableFuture.completedFuture(null);
}
Expand Down

0 comments on commit 6a9eff5

Please sign in to comment.