diff --git a/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php b/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php index eef71587cdd46..29b0a54a92119 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php @@ -83,6 +83,10 @@ protected function processValue($value, $isRoot = false) } } + if (false === $this->container->has((string) $value) && $graph->hasNode($currentId)) { + return $value; + } + throw new ServiceNotFoundException($id, $currentId); } }