diff --git a/roulier/carriers/dpd_fr_soap/encoder.py b/roulier/carriers/dpd_fr_soap/encoder.py index 54695bf..b685fae 100755 --- a/roulier/carriers/dpd_fr_soap/encoder.py +++ b/roulier/carriers/dpd_fr_soap/encoder.py @@ -25,9 +25,9 @@ def transform_input_to_carrier_webservice(self, data): ) # dpd is configure with manage_multi_label = False, so always only 1 pack if ( - data["parcels"] - and data["parcels"][0]["reference"] - and not data["service"]["reference2"] + data.get("parcels") + and data["parcels"][0].get("reference") + and not data["service"].get("reference2") ): data["service"]["reference2"] = data["parcels"][0]["reference"]