Просмотр исходного кода

[DoctrineBundle] fixes undefined index notice

Tobias Naumann 14 лет назад
Родитель
Сommit
ad3fd30365

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

@@ -59,7 +59,7 @@ class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface
             }
 
             foreach ($cs as $connection) {
-                if (!is_array($connections[$connection])) {
+                if (!isset($connections[$connection]) || !is_array($connections[$connection])) {
                     $connections[$connection] = array();
                 }
                 $connections[$connection][] = $attributes['event'];