Use system account when nil

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2021-02-15 08:23:16 -08:00
parent 82de5a3cf8
commit 7cc49f8c62

View File

@@ -6,6 +6,12 @@ import (
)
func (s *Server) publishAdvisory(acc *Account, subject string, adv interface{}) {
if acc == nil {
acc = s.SystemAccount()
if acc == nil {
return
}
}
ej, err := json.Marshal(adv)
if err == nil {
err = s.sendInternalAccountMsg(acc, subject, ej)