diff --git a/src/Composer/Command/InstallCommand.php b/src/Composer/Command/InstallCommand.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Command/InstallCommand.php
+++ b/src/Composer/Command/InstallCommand.php
@@ -208,7 +208,7 @@ EOT
 
                 // force update
                 $newPackage = $composer->getRepositoryManager()->findPackage($package->getName(), $package->getVersion());
-                if ($newPackage->getSourceReference() !== $package->getSourceReference()) {
+                if ($newPackage && $newPackage->getSourceReference() !== $package->getSourceReference()) {
                     $operations[] = new UpdateOperation($package, $newPackage);
                 }
             }
Fix warning when no package to update is found