mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-05 05:07:58 +08:00
Fixed bug that redis nsq adapter cannot work when topics is null. (#5303)
This commit is contained in:
parent
a601a5e3ec
commit
ab513b4a1e
@ -85,7 +85,7 @@ class RedisNsqAdapter extends RedisAdapter
|
||||
$response = $client->stats('json', $this->getChannelKey());
|
||||
if ($response->getStatusCode() == 200) {
|
||||
$json = Json::decode((string) $response->getBody());
|
||||
foreach ($json['topics'] as $topic) {
|
||||
foreach ($json['topics'] ?? [] as $topic) {
|
||||
if (Arr::get($topic, 'topic_name') !== $this->getChannelKey()) {
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user