File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
app/code/Magento/Sales/Model/Order/Shipment Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -389,16 +389,18 @@ public function setExtensionAttributes(\Magento\Sales\Api\Data\ShipmentItemExten
389
389
*/
390
390
private function loadChildren (): void
391
391
{
392
- $ collection = $ this ->_orderItem ->getOrder ()->getItemsCollection ();
393
- $ collection ->filterByParent ($ this ->_orderItem ->getItemId ());
394
-
395
- if ($ collection ->count ()) {
396
- $ this ->_orderItem ->setData ('has_children ' , true );
397
-
398
- /** @var \Magento\Sales\Model\Order\Item $childItem */
399
- foreach ($ collection as $ childItem ) {
400
- if ($ childItem ->getItemId () != $ this ->_orderItem ->getItemId ()) {
401
- $ this ->_orderItem ->addChildItem ($ childItem );
392
+ if ($ this ->_orderItem ) {
393
+ $ collection = $ this ->_orderItem ->getOrder ()->getItemsCollection ();
394
+ $ collection ->filterByParent ($ this ->_orderItem ->getItemId ());
395
+
396
+ if ($ collection ->count ()) {
397
+ $ this ->_orderItem ->setData ('has_children ' , true );
398
+
399
+ /** @var \Magento\Sales\Model\Order\Item $childItem */
400
+ foreach ($ collection as $ childItem ) {
401
+ if ($ childItem ->getItemId () != $ this ->_orderItem ->getItemId ()) {
402
+ $ this ->_orderItem ->addChildItem ($ childItem );
403
+ }
402
404
}
403
405
}
404
406
}
You can’t perform that action at this time.
0 commit comments