diff --git a/pom.xml b/pom.xml index 5f4b85464..7496f51e5 100755 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ net.openhft chronicle-bom - 1.5.19 + 1.5.21-SNAPSHOT pom import diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index cc99e5e21..c079744b9 100755 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -2101,9 +2101,11 @@ class VanillaChronicleMap, KB key, long keySize, InstanceOrBytesToInstance toKey, ReadValue readValue, RV usingValue, InstanceOrBytesToInstance toValue, MultiStoreBytes entry) { + RV v = null; long valueSize = readValueSize(entry); long valuePos = entry.position(); - RV v = readValue.readValue(copies, entry, usingValue, valueSize); + if (!putReturnsNull) + v = readValue.readValue(copies, entry, usingValue, valueSize); // get callbacks if (bytesEventListener != null) { @@ -2234,7 +2236,9 @@ class VanillaChronicleMap, // todo optimize -- prevValue could be read twice if (eventListener != null && !entryIsDeleted) { entry.positionAddr(valueAddr); - prevValueInstance = readValue(copies, entry, null, prevValueSize); + prevValueInstance = null; + if (!putReturnsNull) + prevValueInstance = readValue(copies, entry, null, prevValueSize); } // putValue may relocate entry and change offset