From 05d527446b0c8f411db79082b98dfc045259641b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 22 May 2011 09:10:03 +0200 Subject: [PATCH] addPackage needs to trigger initialization too --- src/Composer/Repository/ArrayRepository.php | 3 +++ 1 file changed, 3 insertions(+) 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; }