From 1f73ec9131e32154febbe04daf1a36724dfa9faf Mon Sep 17 00:00:00 2001 From: Anatolii Date: Wed, 18 Dec 2024 20:38:31 +0200 Subject: [PATCH] fixed get next job method (#53962) --- src/Illuminate/Queue/Worker.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Illuminate/Queue/Worker.php b/src/Illuminate/Queue/Worker.php index 1dd228fb907..49ad0aa3bce 100644 --- a/src/Illuminate/Queue/Worker.php +++ b/src/Illuminate/Queue/Worker.php @@ -355,10 +355,11 @@ protected function getNextJob($connection, $queue) try { if (isset(static::$popCallbacks[$this->name])) { - return tap( - (static::$popCallbacks[$this->name])($popJobCallback, $queue), - fn ($job) => $this->raiseAfterJobPopEvent($connection->getConnectionName(), $job) - ); + if (! is_null($job = (static::$popCallbacks[$this->name])($popJobCallback, $queue))) { + $this->raiseAfterJobPopEvent($connection->getConnectionName(), $job); + } + + return $job; } foreach (explode(',', $queue) as $index => $queue) {