From 66123221976b6c0f637cb52af1f22fb4073e6426 Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Tue, 21 Nov 2017 14:33:29 -0600 Subject: [PATCH] Applies changes from PR #21 --- .../Console/Command/RegenerateProductUrlCommand.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Iazel/RegenProductUrl/Console/Command/RegenerateProductUrlCommand.php b/Iazel/RegenProductUrl/Console/Command/RegenerateProductUrlCommand.php index 762ab21..e12cbcf 100644 --- a/Iazel/RegenProductUrl/Console/Command/RegenerateProductUrlCommand.php +++ b/Iazel/RegenProductUrl/Console/Command/RegenerateProductUrlCommand.php @@ -62,14 +62,16 @@ protected function configure() InputOption::VALUE_REQUIRED, 'Use the specific Store View', Store::DEFAULT_STORE_ID - ) - ; + ); return parent::configure(); } public function execute(InputInterface $inp, OutputInterface $out) { - if (!$this->state->getAreaCode()) { + try { + // this tosses an error if the areacode is not set. + $this->state->getAreaCode(); + } catch (\Exception $ex) { $this->state->setAreaCode('adminhtml'); }