Kaynağa Gözat

addPackage needs to trigger initialization too

Jordi Boggiano 14 yıl önce
ebeveyn
işleme
05d527446b
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  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;
     }