mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Heartbeat#sendEvent(m): nil-check m before dereferencing it
as it can be nil.
This commit is contained in:
parent
4ed4db3ab6
commit
5a79a72ff5
1 changed files with 6 additions and 3 deletions
|
|
@ -179,9 +179,12 @@ func (h *Heartbeat) sendEvent(m *HeartbeatMessage) {
|
|||
select {
|
||||
case old := <-h.events:
|
||||
if old != nil {
|
||||
h.logger.Debugw("Previous heartbeat not read from channel",
|
||||
zap.Time("previous", old.received),
|
||||
zap.Time("current", m.received))
|
||||
kv := []any{zap.Time("previous", old.received)}
|
||||
if m != nil {
|
||||
kv = append(kv, zap.Time("current", m.received))
|
||||
}
|
||||
|
||||
h.logger.Debugw("Previous heartbeat not read from channel", kv...)
|
||||
} else {
|
||||
h.logger.Debug("Previous heartbeat loss event not read from channel")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue