Skip to content

Commit

Permalink
fix: do not pass null to json_decode() (#385)
Browse files Browse the repository at this point in the history
json_decode(): Passing null to parameter #1 ($json) of type string is deprecated
  • Loading branch information
darthf1 authored Mar 21, 2022
1 parent e3eb3c1 commit 71f584d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Cache/RedisStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public function get(string $key, bool $withExpired = false)
}

$contents = $this->redis->get($key);
$contents = json_decode($contents, true);
if (null !== $contents) {
$contents = json_decode($contents, true);
}

if ($withExpired) {
return $contents;
Expand Down

0 comments on commit 71f584d

Please sign in to comment.