historian: Do not crash if we get an unknown address type

This commit is contained in:
Christian Decker
2021-12-19 15:15:14 +01:00
parent 7d3e7a12a4
commit 38d1f337a9

View File

@@ -235,7 +235,8 @@ def parse_address(b):
elif a.typ == 4:
a.addr = b.read(35)
else:
raise ValueError("Unknown address type {typ}".format(typ=a.typ))
print(f"Unknown address type {a.typ}")
return None
a.port, = struct.unpack("!H", b.read(2))
return a