diff --git a/internal/message_queue/nats/client/nats_jetstream/nats_jetstream_client.go b/internal/message_queue/nats/client/nats_jetstream/nats_jetstream_client.go index 60559b75a..d893af025 100644 --- a/internal/message_queue/nats/client/nats_jetstream/nats_jetstream_client.go +++ b/internal/message_queue/nats/client/nats_jetstream/nats_jetstream_client.go @@ -307,6 +307,10 @@ func (cl *Client) Subscribe(topic string, msgFunc func([]byte) error) error { } func (cl *Client) Shutdown() { + if cl == nil { + return + } + if cl.removableStreamConsumerMapping != nil { for stream, consumer := range cl.removableStreamConsumerMapping { err := cl.js.DeleteConsumer(context.Background(), stream, consumer)