diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 23dda6548..a49f79934 100755 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -203,7 +203,7 @@ public class VanillaChronicleMap @Override public final long longSize() { long result = 0L; - if (!isClosed()) + if (!isClosed() && this.cxt != null) try (IterationContext c = iterationContext()) { for (int segmentIndex = 0; segmentIndex < segments(); segmentIndex++) { c.initSegmentIndex(segmentIndex);