diff --git a/Mage/Command/Factory.php b/Mage/Command/Factory.php index a006efa..1ba9b4d 100644 --- a/Mage/Command/Factory.php +++ b/Mage/Command/Factory.php @@ -38,6 +38,11 @@ class Factory $commandName = str_replace(' ', '_', ucwords(str_replace('/', ' ', $commandName))); $className = 'Mage\\Command\\BuiltIn\\' . $commandName . 'Command'; + + if (!class_exists($className)) { + throw new Exception('Command "' . $commandName . '" not found.'); + } + /** @var AbstractCommand $instance */ $instance = new $className; if (!is_a($instance, "Mage\Command\AbstractCommand")) { diff --git a/Mage/Task/Factory.php b/Mage/Task/Factory.php index d854c42..fce6050 100644 --- a/Mage/Task/Factory.php +++ b/Mage/Task/Factory.php @@ -54,6 +54,10 @@ class Factory $className = 'Mage\\Task\\BuiltIn\\' . str_replace(' ', '\\', ucwords(str_replace('/', ' ', $taskName))) . 'Task'; } + if (!class_exists($className)) { + throw new Exception('Task "' . $taskName . '" not found.'); + } + $instance = new $className($taskConfig, $inRollback, $stage, $taskParameters); if (!is_a($instance, 'Mage\Task\AbstractTask')) {