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

Check for null elementOptionality entry for code action cvc_complex_type_2_4_b #1281

Merged
merged 1 commit into from
Aug 18, 2022

Conversation

JessicaJHee
Copy link
Contributor

Fixes #1280

Signed-off-by: Jessica He [email protected]

@@ -335,7 +335,8 @@ public boolean isOptional(String childElementName) {
}
}
}
return elementOptionality.get(childElementName);
Boolean isOptional = elementOptionality.get(childElementName);
Copy link
Contributor

@angelozerr angelozerr Aug 18, 2022

Choose a reason for hiding this comment

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

I think it should be better to write (not tested):

return elementOptionality.getOrDefault(childElementName, false);

@angelozerr
Copy link
Contributor

@JessicaJHee do you think we could have a simple test for this PR? If it is too complex, please ignore my comment.

@JessicaJHee
Copy link
Contributor Author

@JessicaJHee do you think we could have a simple test for this PR? If it is too complex, please ignore my comment.

yes we can, but the result from the code action would be incorrect.

@angelozerr
Copy link
Contributor

Yes you are righr but this test will be fixed again with
#1278

I mean that you will have test that you should adjust.

@angelozerr
Copy link
Contributor

Thanks @JessicaJHee !

@angelozerr angelozerr modified the milestone: 0.22.0 Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Null pointer exception when processing code action cvc_complex_type_2_4_b
2 participants