1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-23 09:41:48 +02:00

bugfix(redis-storage): Unserialise is sometimes false (#773)

This is likely indicative of a deeper issue with the data being fetched but when there is a problem with unserialize, we should fallback to an empty array when the unserialize function returns false.
This commit is contained in:
Clara
2025-05-07 20:15:00 +10:00
committed by GitHub
parent 138ff3d0fb
commit 61334cf54e

View File

@@ -46,7 +46,7 @@ class RedisStorage implements StorageInterface
*/
public function get($id)
{
return array_merge(unserialize($this->redis->hGet("$this->hash:data", $id)),
return array_merge(unserialize($this->redis->hGet("$this->hash:data", $id)) ?: [],
array('__meta' => unserialize($this->redis->hGet("$this->hash:meta", $id))));
}