Skip to content

Commit 612c776

Browse files
authored
Merge pull request #1390 from algolia/feature/MAGE-681-NS-POV
Feature/mage 681 ns pov
2 parents 7cac6f9 + e7c2b8e commit 612c776

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Helper/Entity/ProductHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ public function setSettings($indexName, $indexNameTmp, $storeId, $saveToTmpIndic
469469
// Merge current replicas with sorting replicas to not delete A/B testing replica indices
470470
try {
471471
$currentSettings = $this->algoliaHelper->getSettings($indexName);
472-
if (array_key_exists('replicas', $currentSettings)) {
472+
if (is_array($currentSettings) && array_key_exists('replicas', $currentSettings)) {
473473
$replicas = array_values(array_unique(array_merge($replicas, $currentSettings['replicas'])));
474474
}
475475
} catch (AlgoliaException $e) {

Model/Observer/SaveSettings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function execute(Observer $observer)
6767
foreach ($storeIds as $storeId) {
6868
$indexName = $this->helper->getIndexName($this->productHelper->getIndexNameSuffix(), $storeId);
6969
$currentSettings = $this->algoliaHelper->getSettings($indexName);
70-
if (array_key_exists('replicas', $currentSettings)) {
70+
if (is_array($currentSettings) && array_key_exists('replicas', $currentSettings)) {
7171
$this->algoliaHelper->setSettings($indexName, ['replicas' => []]);
7272
$setReplicasTaskId = $this->algoliaHelper->getLastTaskId();
7373
$this->algoliaHelper->waitLastTask($indexName, $setReplicasTaskId);

0 commit comments

Comments
 (0)