Null values have no keys in the map, so this test fails. In most casses we're here after we resolve a getter so we know this key is valid. Skip the check.

This commit is contained in:
Greg Burd 2018-01-25 12:41:13 -05:00
parent f168b33f6a
commit 96a8476fd8

View file

@ -111,13 +111,11 @@ public abstract class AbstractEntityDraft<E> implements Drafted<E> {
if (value != null) { if (value != null) {
if (entity != null) { if (entity != null) {
if (entityMap.containsKey(key)) {
T currentValue = this.<T>fetch(key); T currentValue = this.<T>fetch(key);
if (currentValue != null && !value.equals(currentValue)) { if (currentValue != null && !value.equals(currentValue)) {
backingMap.put(key, value); backingMap.put(key, value);
return value; return value;
} }
}
} else { } else {
backingMap.put(key, value); backingMap.put(key, value);
} }