瀏覽代碼

[Console] fixed Command::setApplication() when the argument is null

Fabien Potencier 14 年之前
父節點
當前提交
01d583e889
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/Symfony/Component/Console/Command/Command.php

+ 5 - 1
src/Symfony/Component/Console/Command/Command.php

@@ -77,7 +77,11 @@ class Command
     public function setApplication(Application $application = null)
     {
         $this->application = $application;
-        $this->setHelperSet($application->getHelperSet());
+        if ($application) {
+            $this->setHelperSet($application->getHelperSet());
+        } else {
+            $this->helperSet = null;
+        }
     }
 
     /**