NullPointerExcption when comparing not initialized list with initialized list #240
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.
The text was updated successfully, but these errors were encountered: