Преглед на файлове

[DoctrineBundle] Do not try to fetch doctrine listeners if doctrine is not enabled

Jordi Boggiano преди 14 години
родител
ревизия
c2a8ca782b
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      src/Symfony/Bundle/DoctrineBundle/DependencyInjection/Compiler/RegisterEventListenersAndSubscribersPass.php

+ 4 - 0
src/Symfony/Bundle/DoctrineBundle/DependencyInjection/Compiler/RegisterEventListenersAndSubscribersPass.php

@@ -15,6 +15,10 @@ class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface
 
     public function process(ContainerBuilder $container)
     {
+        if (!$container->hasDefinition('doctrine')) {
+            return;
+        }
+
         $this->container = $container;
         $this->connections = $container->getDefinition('doctrine')->getArgument(1);