diff --git a/server/jetstream_cluster.go b/server/jetstream_cluster.go index b7cc09cd21..9d7fc0550d 100644 --- a/server/jetstream_cluster.go +++ b/server/jetstream_cluster.go @@ -2266,7 +2266,7 @@ func (js *jetStream) monitorStream(mset *stream, sa *streamAssignment, sendSnaps // from underneath the one that is running since it will be the same raft node. defer func() { // We might be closing during shutdown, don't pre-emptively stop here since we'll still want to install snapshots. - if !mset.closed.Load() { + if mset != nil && !mset.closed.Load() { n.Stop() } }()