From a211e2b7c11ed356c663f0aae4e7593f0153c161 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Mon, 8 Jan 2024 12:47:31 -0600 Subject: [PATCH] Fix test hitting panic if len(msgs)==0 --- wsbroadcastserver/clientconnection.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wsbroadcastserver/clientconnection.go b/wsbroadcastserver/clientconnection.go index 82b9603a0e..6f5bf54e4d 100644 --- a/wsbroadcastserver/clientconnection.go +++ b/wsbroadcastserver/clientconnection.go @@ -140,6 +140,9 @@ func (cc *ClientConnection) writeBacklog(ctx context.Context, segment backlog.Ba msgs = msgs[requestedIdx:] } } + if len(msgs) == 0 { + break + } isFirstSegment = false bm := &m.BroadcastMessage{ Version: m.V1,