From 792546d007b2ec06647d1e5a4ab35fcfc1380bfa Mon Sep 17 00:00:00 2001 From: Ivan Chaplygin Date: Wed, 7 Jun 2023 13:39:01 +0300 Subject: [PATCH] ref #90088 fix code --- src/upload/admin/model/extension/retailcrm/references.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/upload/admin/model/extension/retailcrm/references.php b/src/upload/admin/model/extension/retailcrm/references.php index 0ad36df..fe76a77 100644 --- a/src/upload/admin/model/extension/retailcrm/references.php +++ b/src/upload/admin/model/extension/retailcrm/references.php @@ -165,11 +165,13 @@ class ModelExtensionRetailcrmReferences extends Model { $response = $this->retailcrmApiClient->sitesList(); - if (!$response) { + if (!$response || !$response->isSuccessful()) { return []; } - return (!$response->isSuccessful()) ? [] : end($response->sites); + $sites = $response->sites; + + return end($sites); } /**