Skip to content

Commit b179fb8

Browse files
committed
return chunk with fillValue if chunkHandle does not exist
1 parent 0cc28e4 commit b179fb8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/dev/zarr/zarrjava/v3/Array.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ public ucar.ma2.Array read(final long[] offset, final int[] shape) throws ZarrEx
173173

174174
final String[] chunkKeys = metadata.chunkKeyEncoding.encodeChunkKey(chunkCoords);
175175
final StoreHandle chunkHandle = storeHandle.resolve(chunkKeys);
176-
176+
if (!chunkHandle.exists()) {
177+
return;
178+
}
177179
if (codecPipeline.supportsPartialDecode()) {
178180
final ucar.ma2.Array chunkArray = codecPipeline.decodePartial(chunkHandle,
179181
Utils.toLongArray(chunkProjection.chunkOffset), chunkProjection.shape);

0 commit comments

Comments
 (0)