1
0
Fork 0

Handle missing license when showing license summary (#10537)

Fixes the issue of license summary command aborting when a package is
missing license information.
pull/10516/head
Marko H. Tamminen 2022-02-16 13:17:49 +02:00 committed by GitHub
parent a3e6af54f9
commit 8756f54da0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}