Skip to content

Commit

Permalink
[Cache] Make sure we get the correct number of values from redis::mget()
Browse files Browse the repository at this point in the history
  • Loading branch information
thePanz authored and nicolas-grekas committed Nov 27, 2019
1 parent ed101fb commit 685c36c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Symfony/Component/Cache/Traits/RedisTrait.php
Expand Up @@ -179,7 +179,13 @@ protected function doFetch(array $ids)
}
});
} else {
$values = array_combine($ids, $this->redis->mget($ids));
$values = $this->redis->mget($ids);

if (!\is_array($values) || \count($values) !== \count($ids)) {
return [];
}

$values = array_combine($ids, $values);
}

foreach ($values as $id => $v) {
Expand Down

0 comments on commit 685c36c

Please sign in to comment.