Skip to content
This repository was archived by the owner on May 27, 2023. It is now read-only.

Commit 59d0cca

Browse files
Prevent fatal error when indexer is not present.
1 parent fba0746 commit 59d0cca

File tree

1 file changed

+5
-4
lines changed
  • app/code/community/EcomDev/PHPUnit/Model/Mysql4/Fixture/Eav

1 file changed

+5
-4
lines changed

app/code/community/EcomDev/PHPUnit/Model/Mysql4/Fixture/Eav/Abstract.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ public function runRequiredIndexers()
5757
if (empty($this->_options['doNotIndexAll'])) {
5858
$indexer = Mage::getSingleton('index/indexer');
5959
foreach ($this->getRequiredIndexers() as $indexerCode) {
60-
if (empty($this->_options['doNotIndex'])
61-
|| !in_array($indexerCode, $this->_options['doNotIndex'])) {
62-
$indexer->getProcessByCode($indexerCode)
63-
->reindexAll();
60+
if (empty($this->_options['doNotIndex']) || !in_array($indexerCode, $this->_options['doNotIndex'])) {
61+
$process = $indexer->getProcessByCode($indexerCode);
62+
if ($process) {
63+
$process->reindexAll();
64+
}
6465
}
6566
}
6667
}

0 commit comments

Comments
 (0)