Skip to content

Commit 9f5540a

Browse files
ekawas-vrifyJamesParrott
authored andcommitted
Fix UnboundLocalError when reading byte_stream
1 parent 6fa929c commit 9f5540a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/shapefile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,7 @@ class _HasM(_CanHaveBBox):
14931493
def _read_ms_from_byte_stream(
14941494
b_io: ReadSeekableBinStream, nPoints: int, next_shape: int
14951495
) -> tuple[MBox, list[float | None]]:
1496+
mbox = None # Ensure mbox is always defined
14961497
if next_shape - b_io.tell() >= 16:
14971498
mbox = unpack("<2d", b_io.read(16))
14981499
# Measure values less than -10e38 are nodata values according to the spec

0 commit comments

Comments
 (0)