Skip to content

Commit

Permalink
fix nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Heckel committed Dec 27, 2021
1 parent e7f8fc9 commit 01a1d98
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,11 @@ func (s *Server) updateStatsAndPrune() {
messages += msgs
}

// Mail
mailSuccess, mailFailure := s.smtpBackend.Counts()
// Mail stats
var mailSuccess, mailFailure int64
if s.smtpBackend != nil {
mailSuccess, mailFailure = s.smtpBackend.Counts()
}

// Print stats
log.Printf("Stats: %d message(s) published, %d in cache, %d successful mails, %d failed, %d topic(s) active, %d subscriber(s), %d visitor(s)",
Expand Down

0 comments on commit 01a1d98

Please sign in to comment.