diff --git a/java-util/src/main/java/io/druid/java/util/common/io/smoosh/SmooshedFileMapper.java b/java-util/src/main/java/io/druid/java/util/common/io/smoosh/SmooshedFileMapper.java index 38d79888a404..d7c284b8a830 100644 --- a/java-util/src/main/java/io/druid/java/util/common/io/smoosh/SmooshedFileMapper.java +++ b/java-util/src/main/java/io/druid/java/util/common/io/smoosh/SmooshedFileMapper.java @@ -19,7 +19,6 @@ package io.druid.java.util.common.io.smoosh; -import com.google.common.base.Throwables; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.io.Closeables; @@ -143,6 +142,9 @@ public void close() { Throwable thrown = null; for (MappedByteBuffer mappedByteBuffer : buffersList) { + if (mappedByteBuffer == null) { + continue; + } try { ByteBufferUtils.unmap(mappedByteBuffer); } @@ -154,6 +156,9 @@ public void close() } } } - Throwables.propagateIfPossible(thrown); + buffersList.clear(); + if (thrown != null) { + throw new RuntimeException(thrown); + } } }