1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 17:12:51 +00:00

ComposerRepository: handle packages.json with null value for package (#10189)

This commit is contained in:
Stephan 2021-10-19 12:14:12 +01:00 committed by GitHub
parent 37ce8969a4
commit 261d93aacf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1038,8 +1038,10 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
// legacy repo handling
if (!isset($data['packages']) && !isset($data['includes'])) {
foreach ($data as $pkg) {
foreach ($pkg['versions'] as $metadata) {
$packages[] = $metadata;
if (isset($pkg['versions']) && is_array($pkg['versions'])) {
foreach ($pkg['versions'] as $metadata) {
$packages[] = $metadata;
}
}
}