Skip to content

NPE caused by bad comparison in MdmResourceUtil.java #2876

@tadgh

Description

@tadgh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions