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); } /**