diff --git a/vendor/magento/module-negotiable-quote/Controller/Adminhtml/Quote/GetItemHash.php b/vendor/magento/module-negotiable-quote/Controller/Adminhtml/Quote/GetItemHash.php index dc5b5b4336c6..7796bb3fa93c 100644 --- a/vendor/magento/module-negotiable-quote/Controller/Adminhtml/Quote/GetItemHash.php +++ b/vendor/magento/module-negotiable-quote/Controller/Adminhtml/Quote/GetItemHash.php @@ -63,10 +63,14 @@ public function execute(): ResultInterface throw new LocalizedException(__('There was a problem updating configuration')); } $items = $quote->getAllVisibleItems(); - $item = end($items); $responseData = []; - $responseData['new_config_hash'] = $this->quoteItemHashHandler->getItemHashToIdItem($item); - $responseData['previous_config_hash'] = $data['item_hash']; + if (empty($items)) { + $responseData['new_config_hash'] = $responseData['previous_config_hash'] = $data['item_hash']; + } else { + $item = end($items); + $responseData['new_config_hash'] = $this->quoteItemHashHandler->getItemHashToIdItem($item); + $responseData['previous_config_hash'] = $data['item_hash']; + } $resultJson->setData($responseData); return $resultJson; }