Forráskód Böngészése

addPackage needs to trigger initialization too

Jordi Boggiano 14 éve
szülő
commit
05d527446b
1 módosított fájl, 3 hozzáadás és 0 törlés
  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;
     }