Skip to content

Commit

Permalink
Fix retention of sequence number logic to handle no record pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
chad-earthscope committed Jun 14, 2024
1 parent 1bca856 commit 778ae02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mseedlib/msrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ def pack(self, handler, handlerdata=None, datasamples=None, sampletype=None,
self._samplecnt = len_datasamples

# Retain miniSEED "sequence number" if parsed record is v2
if self.formatversion == 2 and self._record is not None:
if self.formatversion == 2 and self._record:
# Extract sequence number from record, first 6 bytes are ASCII digits
sequence_string = self._record[0:6].decode('utf-8')
sequence_number = int(sequence_string)

Expand Down

0 comments on commit 778ae02

Please sign in to comment.