diff --git a/src/pyrmv/classes/trip.py b/src/pyrmv/classes/trip.py index dd41494..e62c6dc 100644 --- a/src/pyrmv/classes/trip.py +++ b/src/pyrmv/classes/trip.py @@ -19,8 +19,10 @@ class Trip: self.index: int = data["idx"] self.id: str = data["tripId"] self.ctx_recon: str = data["ctxRecon"] - self.duration: Union[Duration, timedelta] = parse_duration(data["duration"]) - self.real_time_duration: Union[Duration, timedelta] = ( + self.duration: Union[Duration, timedelta, None] = ( + None if "duration" not in data else parse_duration(data["duration"]) + ) + self.real_time_duration: Union[Duration, timedelta, None] = ( None if "rtDuration" not in data else parse_duration(data["rtDuration"]) ) self.checksum: str = data["checksum"]