mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-21 22:08:41 +00:00
be more defensive about array index
This commit is contained in:
parent
88938b7fd1
commit
092c9b9f29
|
|
@ -115,7 +115,12 @@ final class Currency
|
|||
self::$ecbCurrencies = [];
|
||||
|
||||
foreach ($node as $key => $value) {
|
||||
self::$ecbCurrencies[\strtoupper((string) $value->attributes()['currency'])] = (float) $value->attributes()['rate'];
|
||||
/** @var null|array<string, string|int|float> $attributes */
|
||||
if (($attributes = $value->attributes()) === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
self::$ecbCurrencies[\strtoupper((string) ($attributes['currency']))] = (float) ($attributes['rate']);
|
||||
}
|
||||
} catch (\Throwable $t) {
|
||||
self::$ecbCurrencies = []; // @codeCoverageIgnore
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user