fix nil pointer

pull/67/head
Philipp Heckel 2021-12-27 22:18:15 +01:00
parent e7f8fc93e4
commit 01a1d981cf
1 changed files with 5 additions and 2 deletions

View File

@ -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)",