mirror of
https://github.com/mochi-mqtt/server.git
synced 2025-10-27 18:10:38 +08:00
Ensure OnError is set before using it
This commit is contained in:
@@ -484,9 +484,11 @@ func (s *Server) processPublish(cl *clients.Client, pk packets.Packet) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
if s.Events.OnError != nil {
|
||||
s.Events.OnError(cl.Info(), err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if pk.FixedHeader.Retain {
|
||||
s.retainMessage(cl, pk)
|
||||
|
||||
Reference in New Issue
Block a user