diff --git a/vendor/magento/module-checkout/Controller/Cart/CouponPost.php b/vendor/magento/module-checkout/Controller/Cart/CouponPost.php index fdfe817f354f..7b56ab223d1f 100644 --- a/vendor/magento/module-checkout/Controller/Cart/CouponPost.php +++ b/vendor/magento/module-checkout/Controller/Cart/CouponPost.php @@ -20,8 +20,6 @@ class CouponPost extends \Magento\Checkout\Controller\Cart implements HttpPostAc protected $quoteRepository; /** - * Coupon factory - * * @var \Magento\SalesRule\Model\CouponFactory */ protected $couponFactory; @@ -70,10 +68,10 @@ public function execute() { $couponCode = $this->getRequest()->getParam('remove') == 1 ? '' - : trim($this->getRequest()->getParam('coupon_code')); + : trim($this->getRequest()->getParam('coupon_code', '')); $cartQuote = $this->cart->getQuote(); - $oldCouponCode = $cartQuote->getCouponCode(); + $oldCouponCode = $cartQuote->getCouponCode() ?? ''; $codeLength = strlen($couponCode); if (!$codeLength && !strlen($oldCouponCode)) {