diff --git a/src/PathautoGenerator.php b/src/PathautoGenerator.php index 04a6ded..0cd88ed 100644 --- a/src/PathautoGenerator.php +++ b/src/PathautoGenerator.php @@ -175,6 +175,18 @@ class PathautoGenerator implements PathautoGeneratorInterface { return NULL; } + if ($internalPath === '') { + try { + $route_name = $entity->toUrl()->getRouteName(); + } + catch (\UnexpectedValueException $exception) { + return NULL; + } + if ($route_name === '') { + return NULL; + } + } + $source = '/' . $internalPath; $config = $this->configFactory->get('pathauto.settings'); $langcode = $entity->language()->getId();