diff --git a/src/Composer/Command/LicensesCommand.php b/src/Composer/Command/LicensesCommand.php index 5375ab08dcfc..f25a1a61ed02 100644 --- a/src/Composer/Command/LicensesCommand.php +++ b/src/Composer/Command/LicensesCommand.php @@ -125,7 +125,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $usedLicenses = array(); foreach ($packages as $package) { $license = $package instanceof CompletePackageInterface ? $package->getLicense() : array(); - $licenseName = $license[0]; + $licenseName = $license[0] ?? 'none'; if (!isset($usedLicenses[$licenseName])) { $usedLicenses[$licenseName] = 0; }