浏览代码

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

Kévin Dunglas 14 年之前
父节点
当前提交
915973f458
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/Symfony/Bundle/DoctrineMongoDBBundle/Logger/DoctrineMongoDBLogger.php

+ 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) {