diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 40a041927..b98a88c12 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -387,7 +387,7 @@ class Installer $this->io->writeError('Updating dependencies'); // if we're updating mirrors we want to keep exactly the same versions installed which are in the lock file, but we want current remote metadata - if ($this->updateMirrors) { + if ($this->updateMirrors && $lockedRepository) { foreach ($lockedRepository->getPackages() as $lockedPackage) { $request->requireName($lockedPackage->getName(), new Constraint('==', $lockedPackage->getVersion())); }