Handle missing license when showing license summary (#10537)

Fixes the issue of license summary command aborting when a package is
missing license information.
main
Marko H. Tamminen 2 years ago committed by GitHub
parent a3e6af54f9
commit 8756f54da0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -125,7 +125,8 @@ EOT
$usedLicenses = array();
foreach ($packages as $package) {
$license = $package instanceof CompletePackageInterface ? $package->getLicense() : array();
$licenseName = $license[0];
$licenseName = array_key_exists(0, $license) ? $license[0] : 'none';
if (!isset($usedLicenses[$licenseName])) {
$usedLicenses[$licenseName] = 0;
}

Loading…
Cancel
Save