Skip to content

Commit c127a95

Browse files
committed
fix: crash on accessing $currentJob before initialization
1 parent 611891b commit c127a95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Queue/RabbitMQQueue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class RabbitMQQueue extends Queue implements QueueContract, RabbitMQQueueContrac
5454
/**
5555
* Current job being processed.
5656
*/
57-
protected RabbitMQJob $currentJob;
57+
protected ?RabbitMQJob $currentJob = null;
5858

5959
/**
6060
* Holds the Configuration
@@ -577,7 +577,7 @@ protected function getRandomId(): string
577577
*/
578578
public function close(): void
579579
{
580-
if (! $this->currentJob->isDeletedOrReleased()) {
580+
if ($this->currentJob && ! $this->currentJob->isDeletedOrReleased()) {
581581
$this->reject($this->currentJob, true);
582582
}
583583

0 commit comments

Comments
 (0)