Skip to content

Commit

Permalink
Prevent decoding if redis returns null (key does not exist)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swanty authored May 14, 2018
1 parent e8e8720 commit c623297
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Spiritix/LadaCache/Cache.php
Original file line number Diff line number Diff line change
@@ -105,6 +105,11 @@ public function get($key)
{
$encoded = $this->redis->get($this->redis->prefix($key));

// Prevent decoding if redis returns null (key does not exist).
if ($encoded === null) {
return null;
}

return $this->encoder->decode($encoded);
}

0 comments on commit c623297

Please sign in to comment.