From ff67cdf6e6c9933e925950b0f407b03294456c36 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 7 Jun 2023 16:19:44 +0200 Subject: [PATCH] Ignore ICU CDLR version fetching when ICU cannot initialize the resource bundle, fixes #11492 --- src/Composer/Repository/PlatformRepository.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index 116f2b2dc..2e90e05f3 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -333,8 +333,10 @@ class PlatformRepository extends ArrayRepository // Add a separate version for the CLDR library version if ($this->runtime->hasClass('ResourceBundle')) { - $cldrVersion = $this->runtime->invoke(['ResourceBundle', 'create'], ['root', 'ICUDATA', false])->get('Version'); - $this->addLibrary('icu-cldr', $cldrVersion, 'ICU CLDR project version'); + $resourceBundle = $this->runtime->invoke(['ResourceBundle', 'create'], ['root', 'ICUDATA', false]); + if ($resourceBundle !== null) { + $this->addLibrary('icu-cldr', $resourceBundle->get('Version');, 'ICU CLDR project version'); + } } if ($this->runtime->hasClass('IntlChar')) {