diff --git a/src/Composer/Repository/ArrayRepository.php b/src/Composer/Repository/ArrayRepository.php index a1afc5343..fb7025e9f 100644 --- a/src/Composer/Repository/ArrayRepository.php +++ b/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; }