Explorar o código

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

Fabien Potencier %!s(int64=14) %!d(string=hai) anos
pai
achega
01d583e889
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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;
+        }
     }
 
     /**