Explorar el Código

addPackage needs to trigger initialization too

Jordi Boggiano hace 14 años
padre
commit
05d527446b
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/Composer/Repository/ArrayRepository.php

+ 3 - 0
src/Composer/Repository/ArrayRepository.php

@@ -30,6 +30,9 @@ class ArrayRepository implements RepositoryInterface
      */
     public function addPackage(PackageInterface $package)
     {
+        if (null === $this->packages) {
+            $this->initialize();
+        }
         $package->setRepository($this);
         $this->packages[] = $package;
     }