diff --git a/src/Module/ModuleLanguageSwitcher.php b/src/Module/ModuleLanguageSwitcher.php index c164175..d3f4d08 100644 --- a/src/Module/ModuleLanguageSwitcher.php +++ b/src/Module/ModuleLanguageSwitcher.php @@ -16,6 +16,7 @@ use Hofff\Contao\LanguageRelations\LanguageRelations; use Hofff\Contao\LanguageRelations\Util\ContaoUtil; use Locale; +use Symfony\Component\Routing\Exception\ResourceNotFoundException; use function array_filter; use function array_flip; @@ -144,6 +145,8 @@ protected function compile(): void $url = $page->getFrontendUrl($params, $language); } catch (RouteParametersException $exception) { $url = ''; + } catch (ResourceNotFoundException $exception) { + $url = ''; } $item = [];