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

NullPointerExcption when comparing not initialized list with initialized list #240

Closed
jenspopp opened this issue Oct 30, 2015 · 2 comments
Closed

Comments

@jenspopp
Copy link

I use the LevenshteinListChangeAppender to compare objects containing lists. The Obejcts are unmarshalled from XML. Unmarshalling leaves empty Lists as "null" in the variable, they are only initialized, when the get method is first called.

If I compare an empty list (=null) with a list containing values, I get a NullPointerException in org.javers.core.diff.appenders.levenshtein.Backtrack line 21/22 because the Lists are accessed without check for null.

It would be good to check for null first and initialize the check with an empty list if null is returned. Alternatively the get method could be used instead of directly accessing the list variable in the class.

@bartoszwalacik
Copy link
Member

right, looks like we dont check for nulls here

bartoszwalacik added a commit that referenced this issue Nov 7, 2015
bartoszwalacik added a commit that referenced this issue Nov 7, 2015
@bartoszwalacik
Copy link
Member

fixed in release 1.3.20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants