mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Protect against cluster and meta being gone
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -2615,7 +2615,10 @@ func (js *jetStream) applyConsumerEntries(o *consumer, ce *CommittedEntry, isLea
|
||||
o.store.Update(state)
|
||||
} else if e.Type == EntryRemovePeer {
|
||||
js.mu.RLock()
|
||||
ourID := js.cluster.meta.ID()
|
||||
var ourID string
|
||||
if js.cluster != nil && js.cluster.meta != nil {
|
||||
ourID = js.cluster.meta.ID()
|
||||
}
|
||||
js.mu.RUnlock()
|
||||
if peer := string(e.Data); peer == ourID {
|
||||
o.stopWithFlags(true, false, false)
|
||||
|
||||
Reference in New Issue
Block a user