Skip to content

Commit 7f61b32

Browse files
committed
MAGETWO-94347: Implement handling of large number of addresses on storefront Address book
1 parent 37bda71 commit 7f61b32

File tree

1 file changed

+4
-3
lines changed
  • app/code/Magento/Customer/Block/Address

1 file changed

+4
-3
lines changed

app/code/Magento/Customer/Block/Address/Grid.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,15 @@ private function preparePager(): void
227227
*/
228228
private function getAddressCollection(): \Magento\Customer\Model\ResourceModel\Address\Collection
229229
{
230-
if (null === $this->addressCollection && $this->getCustomer()) {
230+
if (null === $this->addressCollection) {
231+
if (null === $this->getCustomer()) {
232+
throw new NoSuchEntityException(__('Customer not logged in'));
233+
}
231234
/** @var \Magento\Customer\Model\ResourceModel\Address\Collection $collection */
232235
$collection = $this->addressCollectionFactory->create();
233236
$collection->setOrder('entity_id', 'desc')
234237
->setCustomerFilter([$this->getCustomer()->getId()]);
235238
$this->addressCollection = $collection;
236-
} elseif (null === $this->getCustomer()) {
237-
throw new NoSuchEntityException(__('Customer not logged in'));
238239
}
239240
return $this->addressCollection;
240241
}

0 commit comments

Comments
 (0)