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

Ensure getCodeActions() always returns a list and not null. #450

Merged
merged 1 commit into from
May 17, 2023

Conversation

turkeylurkey
Copy link
Contributor

@turkeylurkey turkeylurkey commented May 17, 2023

Fixes #449

Fixes the exception Cannot invoke "java.util.Collection.toArray()" because "<parameter1>" is null

In each case we run code like:
codeActions.addAll(AddPathParamQuickFix.getCodeActions(context, diagnostic, monitor));
and null is not a valid arg to addAll(). This usually does not happen because usually the program is well formed and if the diagnostic can be detected then a quick fix can be created. However in some cases syntax errors are too severe and the quick fix creation fails and a null may be returned.

Signed-off-by: Paul Gooderham <turkeyonmarblerye@gmail.com>
@turkeylurkey turkeylurkey added the bug Something isn't working label May 17, 2023
@turkeylurkey turkeylurkey added this to the GA milestone May 17, 2023
@turkeylurkey turkeylurkey self-assigned this May 17, 2023
Copy link
Contributor

@mattbsox mattbsox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Various codeAction failures in VS Code
2 participants