Get values when 0

This commit is contained in:
Juan Pablo Vial
2025-10-03 12:09:54 -03:00
parent fe8bbb5767
commit ecae3147d4
4 changed files with 9 additions and 5 deletions

View File

@ -19,7 +19,7 @@ class USD
$usds = [];
try {
$usds = json_decode($this->redisService->get($this->redisKey), JSON_OBJECT_AS_ARRAY);
if (!isset($usds[$date->format('Y-m-d')])) {
if (!isset($usds[$date->format('Y-m-d')]) or $usds[$date->format('Y-m-d')] === 0) {
throw new EmptyRedis($this->redisKey);
}
$usd = $usds[$date->format('Y-m-d')];