From 29ecd37fc4b8dc9223e9a64e2af7a7f4659a39b0 Mon Sep 17 00:00:00 2001 From: Richard BAYET Date: Wed, 4 Dec 2024 12:06:05 +0100 Subject: [PATCH] [Analytics] Handle case where Magento_Company has been installed, enabled then removed --- .../Block/Adminhtml/Report/CustomerCompanySelector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module-elasticsuite-analytics/Block/Adminhtml/Report/CustomerCompanySelector.php b/src/module-elasticsuite-analytics/Block/Adminhtml/Report/CustomerCompanySelector.php index abdd81d2a..8f88247bf 100644 --- a/src/module-elasticsuite-analytics/Block/Adminhtml/Report/CustomerCompanySelector.php +++ b/src/module-elasticsuite-analytics/Block/Adminhtml/Report/CustomerCompanySelector.php @@ -109,7 +109,7 @@ public function isCompanyEnabled() */ public function getCompaniesList() { - if ($this->isCompanyEnabled()) { + if ($this->isCompanyEnabled() && ($this->companyRepository !== null)) { $searchCriteria = $this->searchCriteriaBuilder->create(); return $this->companyRepository->getList($searchCriteria)->getItems(); // Fetch company list.