1
0
mirror of https://github.com/axllent/mailpit.git synced 2024-12-30 23:17:59 +02:00

UI: Only queue broadcast events if clients are connected

This commit is contained in:
Ralph Slooten 2023-09-25 16:53:25 +13:00
parent 3c744edd20
commit d2086922e5

View File

@ -69,7 +69,7 @@ func (h *Hub) Run() {
// Broadcast will spawn a broadcast message to all connected clients
func Broadcast(t string, msg interface{}) {
if MessageHub == nil {
if MessageHub == nil || len(MessageHub.Clients) == 0 {
return
}