Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE on JsonArray.size() codeAction failure in VSCode after getData() is null #463

Open
evie-lau opened this issue Jun 1, 2023 · 1 comment
Labels
bug Something isn't working should-fix

Comments

@evie-lau
Copy link
Contributor

evie-lau commented Jun 1, 2023

[Error - 2:07:32 PM] Request textDocument/codeAction failed.
  Message: Request jakarta/java/codeaction failed with message: java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonArray.size()" because "diagnosticData" is null
  Code: -32603 

To reproduce:

image

Files that seem to call this method and may have this issue:

@turkeylurkey
Copy link
Contributor

turkeylurkey commented Jun 2, 2023

This is likely caused by the getData() is null problem.

    JsonArray diagnosticData = (JsonArray) diagnostic.getData();

    List<String> annotations = IntStream.range(0, diagnosticData.size())

Related to #416

@turkeylurkey turkeylurkey added bug Something isn't working should-fix labels Jun 5, 2023
@turkeylurkey turkeylurkey changed the title NPE on JsonArray.size() codeAction failure in VSCode NPE on JsonArray.size() codeAction failure in VSCode after getData() is null Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working should-fix
Projects
None yet
Development

No branches or pull requests

2 participants