Skip to content

Commit 0b090c5

Browse files
committed
fix test
1 parent d9e8612 commit 0b090c5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Queue/RabbitMQQueue.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,14 @@ protected function createMessage($payload, int $attempts = 0): array
540540
if ($this->isPrioritizeDelayed()) {
541541
$properties['priority'] = $attempts;
542542
}
543-
$commandData = unserialize($currentPayload['data']['command']);
544-
if (property_exists($commandData, 'priority')) {
545-
$properties['priority'] = $commandData->priority;
543+
544+
if(isset($currentPayload['data']['command'])) {
545+
$commandData = unserialize($currentPayload['data']['command']);
546+
if (property_exists($commandData, 'priority')) {
547+
$properties['priority'] = $commandData->priority;
548+
}
546549
}
550+
547551
$message = new AMQPMessage($payload, $properties);
548552

549553
$message->set('application_headers', new AMQPTable([

0 commit comments

Comments
 (0)