Check that we have mirror still to not panic and deadlock/hang

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2021-04-20 16:41:41 -07:00
parent 902b9dec12
commit ef7a811a71

View File

@@ -1139,6 +1139,10 @@ func (mset *stream) processMirrorMsgs() {
// Grab stream quit channel.
mset.mu.Lock()
if mset.mirror == nil {
mset.mu.Unlock()
return
}
msgs, mch, qch := mset.mirror.msgs, mset.mirror.msgs.mch, mset.qch
// Set the last seen as now so that we don't fail at the first check.
mset.mirror.last = time.Now()