Skip to content

Commit

Permalink
Check for sys being ready before calling sysRequest
Browse files Browse the repository at this point in the history
Signed-off-by: Waldemar Quevedo <wally@nats.io>
  • Loading branch information
wallyqs authored and neilalexander committed Dec 3, 2024
1 parent 1aff49a commit 529eeb2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/jetstream_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -6315,6 +6315,10 @@ func sysRequest[T any](s *Server, subjFormat string, args ...any) (*T, error) {
isubj := fmt.Sprintf(subjFormat, args...)

s.mu.Lock()
if s.sys == nil {
s.mu.Unlock()
return nil, ErrNoSysAccount
}
inbox := s.newRespInbox()
results := make(chan *T, 1)
s.sys.replies[inbox] = func(_ *subscription, _ *client, _ *Account, _, _ string, msg []byte) {
Expand Down

0 comments on commit 529eeb2

Please sign in to comment.