Skip to content

Commit

Permalink
fix: fix key error in binary data (#176)
Browse files Browse the repository at this point in the history
* fix: fix key error in binary data

* pragma
  • Loading branch information
tlambert03 authored Sep 28, 2023
1 parent 6260200 commit 063da7c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/nd2/readers/_modern/modern_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,12 @@ def binary_data(self) -> BinaryLayers | None:
# this will be something like
# b'CustomDataSeq|RleZipBinarySequence_1bd900c|1153!
chunk_key = f"CustomDataSeq|{key}|{plane}!".encode()
data = self._load_chunk(chunk_key)[4:]
if chunk_key in self.chunkmap:
data = self._load_chunk(chunk_key)[4:]
else:
# it's conceivable that some frames don't have binary
# sequence masks written, so we'll just fill in None
data = None # pragma: no cover
_masks.append(decode_binary_mask(data) if data else None)

mask_items.append(
Expand Down

0 comments on commit 063da7c

Please sign in to comment.