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 Deleting Element from AutoMap #67

Open
VirtualTim opened this issue Nov 6, 2023 · 0 comments
Open

NPE Deleting Element from AutoMap #67

VirtualTim opened this issue Nov 6, 2023 · 0 comments

Comments

@VirtualTim
Copy link
Contributor

Code looks like this:

XBProjector projector = new XBProjector();
CloseableMap<String> xmlMap = projector.io().file("path_to_existing_xml_file").bindAsMapOf(String.class);

//Called later on
xmlMap.remove(key);  //Throws NPE in DuplexExpression.deleteAllMatchingChildren, as parentNode is null (?)

//Attempt 2
xmlMap.entrySet().removeIf(entry -> entry.getValue() == null || Objects.equals(entry.getValue(), "")); //Appears to do nothing, I'm guessing it swallows the same NPE

Any ideas?

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

No branches or pull requests

1 participant