Fixed messages attribute

This commit is contained in:
Profitroll 2022-09-24 12:58:29 +02:00
parent 9641a4dab8
commit a868c997ac

View File

@ -14,7 +14,7 @@ class Leg():
self.gis = Gis(data["GisRef"]["ref"], data["GisRoute"]) self.gis = Gis(data["GisRef"]["ref"], data["GisRoute"])
else: else:
self.gis = None self.gis = None
self.index = data["idx"] self.index = data["idx"]
self.name = data["name"] self.name = data["name"]
self.type = data["type"] self.type = data["type"]
@ -25,8 +25,9 @@ class Leg():
self.direction = None self.direction = None
self.messages = [] self.messages = []
for message in data["Messages"]["Message"]: if "Messages" in data:
self.messages.append(Message(message)) for message in data["Messages"]["Message"]:
self.messages.append(Message(message))
if "number" in data: if "number" in data:
self.number = data["number"] self.number = data["number"]