Fix AttributeError: 'NoneType' object has no attribute 'zips'

This commit is contained in:
jmartin 2015-01-28 16:18:01 +01:00
parent a1cf04ad70
commit 9d14e138c5

View file

@ -72,7 +72,7 @@ class Sale:
shipment_zip = (self.shipment_address and self.shipment_address.zip shipment_zip = (self.shipment_address and self.shipment_address.zip
or '') or '')
carrier = self.carrier carrier = self.carrier
if not carrier.zips: if not carrier or not carrier.zips:
return res return res
if (carrier and shipment_zip): if (carrier and shipment_zip):
for carrier_zip in carrier.zips: for carrier_zip in carrier.zips: