diff --git a/src/Kernel/SyliusNoCommerceKernelTrait.php b/src/Kernel/SyliusNoCommerceKernelTrait.php index f733afe..2e61921 100644 --- a/src/Kernel/SyliusNoCommerceKernelTrait.php +++ b/src/Kernel/SyliusNoCommerceKernelTrait.php @@ -13,6 +13,7 @@ namespace MonsieurBiz\SyliusNoCommercePlugin\Kernel; +use Exception; use MonsieurBiz\SyliusNoCommercePlugin\Model\Config; use MonsieurBiz\SyliusNoCommercePlugin\Model\ConfigInterface; use MonsieurBiz\SyliusNoCommercePlugin\Provider\FeaturesProviderInterface; @@ -84,7 +85,12 @@ public function getRoutesToRemove(): array // Loop on settings to add routes /** @var FeaturesProviderInterface $featuresProvider */ $featuresProvider = $this->container->get('monsieurbiz.no_commerce.provider.features_provider'); - $routesToEnable = $featuresProvider->getRoutesToEnable(); + + try { + $routesToEnable = $featuresProvider->getRoutesToEnable(); + } catch (Exception $e) { + $routesToEnable = []; + } foreach ($routesToEnable as $route) { $this->enableRoute($route);