Przeglądaj źródła

[DoctrineMongoDbLogger] fixed the "Call to a member function getDebugLogger() on a non-object" error

Kévin Dunglas 14 lat temu
rodzic
commit
915973f458

+ 4 - 0
src/Symfony/Bundle/DoctrineMongoDBBundle/Logger/DoctrineMongoDBLogger.php

@@ -39,6 +39,10 @@ class DoctrineMongoDBLogger
 
     public function getQueries()
     {
+        if (null === $this->logger) {
+            return false;
+        }
+
         $logger = $this->logger->getDebugLogger();
 
         if (!$logger) {