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 caused by bad comparison in MdmResourceUtil.java #2876

Closed
tadgh opened this issue Aug 9, 2021 · 0 comments · Fixed by #2877
Closed

NPE caused by bad comparison in MdmResourceUtil.java #2876

tadgh opened this issue Aug 9, 2021 · 0 comments · Fixed by #2877

Comments

@tadgh
Copy link
Collaborator

tadgh commented Aug 9, 2021

MdmResourceUtil.java contains several attempts to performing matching on a system, without considering that the tag may not have a system, causing a nullpointer like so:

return theBaseResource.getMeta().getTag().stream()
           .anyMatch(tag -> tag.getSystem().equalsIgnoreCase(theSystem));

if tag.getSystem() == null then this code will produce an NPE. The simple fix here is to flip the equality as the incoming system is non-nullable.

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 a pull request may close this issue.

1 participant