Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Refactor checkout shipping method update mutation

fowczarekf806665c445b
diff --git a/saleor/graphql/checkout/mutations.py b/saleor/graphql/checkout/mutations.py
index f4917d8df8..88be35d9aa 100644
--- a/saleor/graphql/checkout/mutations.py
+++ b/saleor/graphql/checkout/mutations.py
@@ -399,9 +399,10 @@ class CheckoutShippingMethodUpdate(BaseMutation):
info, shipping_method_id, errors, 'shipping_method_id',
only_type=ShippingMethod)
- clean_shipping_method(
- checkout, shipping_method, errors, info.context.discounts,
- info.context.taxes, remove=False)
+ if checkout and shipping_method:
+ clean_shipping_method(
+ checkout, shipping_method, errors, info.context.discounts,
+ info.context.taxes, remove=False)
if errors:
return CheckoutShippingMethodUpdate(errors=errors)