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

Comments

Projects
None yet
2 participants
@jenspopp

jenspopp commented Oct 30, 2015

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 bartoszwalacik added the bug label Oct 30, 2015

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Oct 30, 2015

right, looks like we dont check for nulls here

bartoszwalacik added a commit that referenced this issue Nov 7, 2015

#240
fixed NPE

bartoszwalacik added a commit that referenced this issue Nov 7, 2015

@bartoszwalacik bartoszwalacik added the fixed label Nov 8, 2015

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Nov 8, 2015

fixed in release 1.3.20

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