Skip to content

Commit

Permalink
Add safety check about cache value (#6283)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored Jan 31, 2024
1 parent 79ea9d6 commit f78899c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
use function count;
use function get_class;
use function implode;
use function is_array;
use function is_int;
use function is_string;
use function key;
Expand Down Expand Up @@ -1137,6 +1138,10 @@ public function executeCacheQuery($sql, $params, $types, QueryCacheProfile $qcp)

if ($item->isHit()) {
$value = $item->get();
if (! is_array($value)) {
$value = [];
}

if (isset($value[$realKey])) {
return new Result(new ArrayResult($value[$realKey]), $this);
}
Expand Down

0 comments on commit f78899c

Please sign in to comment.