File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
app/code/Magento/Customer/Block/Address Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -227,14 +227,15 @@ private function preparePager(): void
227
227
*/
228
228
private function getAddressCollection (): \Magento \Customer \Model \ResourceModel \Address \Collection
229
229
{
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
+ }
231
234
/** @var \Magento\Customer\Model\ResourceModel\Address\Collection $collection */
232
235
$ collection = $ this ->addressCollectionFactory ->create ();
233
236
$ collection ->setOrder ('entity_id ' , 'desc ' )
234
237
->setCustomerFilter ([$ this ->getCustomer ()->getId ()]);
235
238
$ this ->addressCollection = $ collection ;
236
- } elseif (null === $ this ->getCustomer ()) {
237
- throw new NoSuchEntityException (__ ('Customer not logged in ' ));
238
239
}
239
240
return $ this ->addressCollection ;
240
241
}
You can’t perform that action at this time.
0 commit comments