From 78329331e04162283707918c7d4acd773534ac12 Mon Sep 17 00:00:00 2001 From: MIGUEL ANGEL GARZON MALDONADO Date: Tue, 7 Feb 2023 11:38:28 +0000 Subject: [PATCH] In reserve method, if the payload is null, throws an error in PHP 8.1 --- src/drivers/redis/Queue.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drivers/redis/Queue.php b/src/drivers/redis/Queue.php index aff79cfe0..b56d1d07f 100644 --- a/src/drivers/redis/Queue.php +++ b/src/drivers/redis/Queue.php @@ -149,6 +149,10 @@ protected function reserve($timeout) } $payload = $this->redis->hget("$this->channel.messages", $id); + if (null === $payload) { + return null; + } + list($ttr, $message) = explode(';', $payload, 2); $this->redis->zadd("$this->channel.reserved", time() + $ttr, $id); $attempt = $this->redis->hincrby("$this->channel.attempts", $id, 1);