fix: save-sync chunk read crash

This commit is contained in:
Paweł Lidwin 2026-04-14 19:09:37 +02:00
parent 41e3cfab82
commit f2056e907c
No known key found for this signature in database
GPG key ID: C6EDF064F9FEE1E1

View file

@ -92,12 +92,14 @@ class Chunk:
return self.stored_as & 0x2
@classmethod
def read_buffer(cls, data, secrets):
def read_buffer(cls, data, secrets=None):
_sio = BytesIO(data)
return cls.read(_sio, secrets)
@classmethod
def read(cls, bio, secrets=dict()):
def read(cls, bio, secrets=None):
if secrets is None:
secrets = dict()
head_start = bio.tell()
if struct.unpack('<I', bio.read(4))[0] != cls.header_magic: