Avoid index reset error in case of unexistant index

This commit is contained in:
Fabien Somnier 2014-02-03 17:50:35 +01:00
parent 5e54dcd955
commit a121a77774

View file

@ -107,7 +107,7 @@ class PopulateCommand extends ContainerAwareCommand
*/ */
private function populateIndex(OutputInterface $output, $index, $reset, $options) private function populateIndex(OutputInterface $output, $index, $reset, $options)
{ {
if ($reset) { if ($reset && $this->indexManager->getIndex($index)->exists()) {
$output->writeln(sprintf('<info>Resetting</info> <comment>%s</comment>', $index)); $output->writeln(sprintf('<info>Resetting</info> <comment>%s</comment>', $index));
$this->resetter->resetIndex($index); $this->resetter->resetIndex($index);
} }