Check creation of CCMessage in NATS receiver

This commit is contained in:
Thomas Roehl 2024-12-27 15:00:14 +00:00
parent 70a6afc549
commit 7d3180b526

View File

@ -91,21 +91,22 @@ func (r *NatsReceiver) _NatsReceive(m *nats.Msg) {
return
}
y, _ := lp.NewMessage(
y, err := lp.NewMessage(
string(measurement),
tags,
nil,
fields,
t,
)
if err == nil {
m, err := r.mp.ProcessMessage(y)
if err == nil && m != nil {
if err == nil && m != nil && r.sink != nil {
r.sink <- m
}
}
}
}
}
// Close closes the connection to the NATS server
func (r *NatsReceiver) Close() {