Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 1530cbd

Browse files
committed
[BUGFIX] Check if item exists because it is possible to delete the item in the submitBefore observer event
1 parent 86eed24 commit 1530cbd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Magento/Tax/Model/Plugin/OrderSave.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ protected function saveOrderTax(\Magento\Sales\Api\Data\OrderInterface $order)
163163
if (isset($quoteItemId['id'])) {
164164
//This is a product item
165165
$item = $order->getItemByQuoteItemId($quoteItemId['id']);
166-
$itemId = $item->getId();
166+
if ($item !== null && $item->getId()) {
167+
$itemId = $item->getId();
168+
}
167169
} elseif (isset($quoteItemId['associated_item_id'])) {
168170
//This item is associated with a product item
169171
$item = $order->getItemByQuoteItemId($quoteItemId['associated_item_id']);

0 commit comments

Comments
 (0)