Skip to content

Commit b2ee935

Browse files
committed
prevent tracking response parsing when shipment info is None
1 parent 586a3a9 commit b2ee935

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

openship/mappers/dhl/dhl_mapper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ def _extract_quote(self, quotes: List[E.quote_details], qtdshpNode) -> List[E.qu
134134
def _extract_tracking(self, trackings: List[E.tracking_details], awbInfoNode) -> List[E.tracking_details]:
135135
awbInfo = TrackRes.AWBInfo()
136136
awbInfo.build(awbInfoNode)
137+
if awbInfo.ShipmentInfo == None:
138+
return trackings
137139
return trackings + [
138140
E.Tracking.parse(
139141
carrier=self.client.carrier_name,

0 commit comments

Comments
 (0)