Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 49b6d7f

Browse files
bug #45279 [Messenger] Fix dealing with unexpected payload in Redis transport (nicoalonso)
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Messenger] Fix dealing with unexpected payload in Redis transport [Redis-Messenger] Exits with error when Messenger starts consuming message | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix # [45022](#45022) | License | MIT | Doc PR | n/a Commits ------- ccacbf2 [Messenger] Fix dealing with unexpected payload in Redis transport
2 parents fe6a247 + ccacbf2 commit 49b6d7f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Messenger/Bridge/Redis/Transport/RedisReceiver.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public function get(): iterable
4646

4747
$redisEnvelope = json_decode($message['data']['message'] ?? '', true);
4848

49+
if (null === $redisEnvelope) {
50+
return [];
51+
}
52+
4953
try {
5054
if (\array_key_exists('body', $redisEnvelope) && \array_key_exists('headers', $redisEnvelope)) {
5155
$envelope = $this->serializer->decode([

0 commit comments

Comments
 (0)