diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index 2cbf6e3f0..d714b3702 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -230,13 +230,15 @@ class Factory $authData = json_decode($composerAuthEnv, true); if (null === $authData) { - throw new \UnexpectedValueException('COMPOSER_AUTH environment variable is malformed, should be a valid JSON object'); - } - - if ($io && $io->isDebug()) { - $io->writeError('Loading auth config from COMPOSER_AUTH'); + if ($io) { + $io->writeError('COMPOSER_AUTH environment variable is malformed, should be a valid JSON object'); + } + } else { + if ($io && $io->isDebug()) { + $io->writeError('Loading auth config from COMPOSER_AUTH'); + } + $config->merge(array('config' => $authData)); } - $config->merge(array('config' => $authData)); } return $config;