diff --git a/vendor/magento/module-checkout/Model/Session.php b/vendor/magento/module-checkout/Model/Session.php
index 3a2beb3b437..d6dcaaed61a 100644
--- a/vendor/magento/module-checkout/Model/Session.php
+++ b/vendor/magento/module-checkout/Model/Session.php
@@ -267,7 +267,9 @@ class Session extends \Magento\Framework\Session\SessionManager
                         ? $this->_customer->getId()
                         : $this->_customerSession->getCustomerId();
 
-                    if ($quote->getData('customer_id') && (int)$quote->getData('customer_id') !== (int)$customerId) {
+                    if ($customerId && $quote->getData('customer_id') &&
+                        (int)$quote->getData('customer_id') !== (int)$customerId
+                    ) {
                         $quote = $this->quoteFactory->create();
                         $this->setQuoteId(null);
                     }
