Skip to content

Commit b851042

Browse files
authored
Merge pull request #70 from ivanhrytsaim/14107-Fatal-error-in-Admin-Orders-page-when-canceling-orders
14107-Fatal-error-in-Admin-Orders-page-when-canceling-orders
2 parents 26909c5 + 4515a56 commit b851042

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Model/DataLayer/Cart/Item.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ class Item extends AbstractDataLayer implements ItemInterface
2121
public function get(QuoteItem $quoteItem): array
2222
{
2323
$product = $this->getItemProduct($quoteItem);
24+
if (!$product || !$product->getId()) {
25+
return [];
26+
}
2427
$categoryNames = $this->getCategoryNames($product);
2528
return array_merge([
2629
'item_id' => ($this->config->getProductAttribute() == 'sku')

Model/DataLayer/Order/Item.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class Item extends AbstractDataLayer implements ItemInterface
2020
public function get(OrderItemInterface $orderItem): array
2121
{
2222
$product = $this->getItemProduct($orderItem);
23+
if (!$product || !$product->getId()) {
24+
return [];
25+
}
2326
$categoryNames = $this->getCategoryNames($product);
2427
return array_merge([
2528
'item_id' => ($this->config->getProductAttribute() == 'sku')

0 commit comments

Comments
 (0)