Check for null for taxable

This commit is contained in:
Woosignal 2020-03-03 22:34:25 +00:00 committed by GitHub
parent 951181daef
commit 1af4f7bd67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -704,13 +704,13 @@ class Cart {
switch (shippingType.methodId) { switch (shippingType.methodId) {
case "flat_rate": case "flat_rate":
FlatRate flatRate = (shippingType.object as FlatRate); FlatRate flatRate = (shippingType.object as FlatRate);
if (flatRate.taxable) { if (flatRate.taxable != null && flatRate.taxable) {
shippingTotal += double.parse(shippingType.cost); shippingTotal += double.parse(shippingType.cost);
} }
break; break;
case "local_pickup": case "local_pickup":
LocalPickup localPickup = (shippingType.object as LocalPickup); LocalPickup localPickup = (shippingType.object as LocalPickup);
if (localPickup.taxable) { if (localPickup.taxable != null && localPickup.taxable) {
shippingTotal += double.parse(localPickup.cost); shippingTotal += double.parse(localPickup.cost);
} }
break; break;