diff --git a/Ui/Component/Batch/Grid/Column/Batches.php b/Ui/Component/Batch/Grid/Column/Batches.php index c56b1ab1..01fd2b9b 100644 --- a/Ui/Component/Batch/Grid/Column/Batches.php +++ b/Ui/Component/Batch/Grid/Column/Batches.php @@ -26,11 +26,11 @@ class Batches extends Column */ protected $urlBuilder; /** - * @var Helper + * @var \Ebizmarts\MailChimp\Model\MailChimpSyncBatches */ protected $mailChimpSyncB; /** - * @var Helper + * @var \Ebizmarts\MailChimp\Helper\Data */ protected $helper; @@ -53,7 +53,7 @@ public function __construct( array $components = [], array $data = [] ) { - $this->_helper = $helper; + $this->helper = $helper; $this->mailChimpSyncB = $mailChimpSyncB; $this->urlBuilder = $urlBuilder; parent::__construct($context, $uiComponentFactory, $components, $data); @@ -96,9 +96,13 @@ public function prepareDataSource(array $dataSource) private function getMCStoreNameById($mailchimp_store_id, $magentoStoreId) { if (!key_exists($mailchimp_store_id, $this->stores)) { - $api = $this->_helper->getApi($magentoStoreId); - $store = $api->ecommerce->stores->get($mailchimp_store_id); - $this->stores[$mailchimp_store_id] = $store['name']; + $api = $this->helper->getApi($magentoStoreId); + try { + $store = $api->ecommerce->stores->get($mailchimp_store_id); + $this->stores[$mailchimp_store_id] = $store['name']; + } catch (\Exception $e) { + $this->stores[$mailchimp_store_id] = 'Not existing store'; + } } return $this->stores[$mailchimp_store_id]; }