File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff 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 ' )
Original file line number Diff line number Diff 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 ' )
You can’t perform that action at this time.
0 commit comments