From 1310ac57e8a62b7637d4ace2a19f21d66b2844f7 Mon Sep 17 00:00:00 2001 From: Jeremy Lacomis Date: Mon, 28 Aug 2023 10:35:25 -0400 Subject: [PATCH] Fix decoding bug related to #10 --- binary/dire_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binary/dire_types.py b/binary/dire_types.py index fadd946..b137c7b 100644 --- a/binary/dire_types.py +++ b/binary/dire_types.py @@ -913,7 +913,7 @@ def start_offsets(self) -> t.Tuple[int, ...]: @classmethod def _from_json(cls, d: t.Dict[str, t.Any]) -> "Union": - return cls(name=d["n"], members=d["m"], padding=d["p"]) + return cls(name=d["n"], members=d["m"], padding=d["p"] if "p" in d else None) def _to_json(self) -> t.Dict[str, t.Any]: encoded = {