Skip to content

Commit 5dfa719

Browse files
committed
ACP2E-2213: Loading order through repository loads the order multiple times from DB
1 parent 1ed25a3 commit 5dfa719

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/Sales/Model/OrderRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public function save(\Magento\Sales\Api\Data\OrderInterface $entity)
281281
if (!empty($shippingAssignments)) {
282282
$shipping = array_shift($shippingAssignments)->getShipping();
283283
$shippingAddress = $shipping->getAddress();
284-
$shippingEmail = $shippingAddress->getEmail();
284+
$shippingEmail = ($shippingAddress !== null) ? $shippingAddress->getEmail() : null;
285285
$shippingMethod = $shipping->getMethod();
286286
$entity->setShippingAddress($shippingAddress);
287287
$entity->setShippingMethod($shippingMethod);

0 commit comments

Comments
 (0)