From 404b6f602a8a0035eb471159f44fdd7fff19cb2e Mon Sep 17 00:00:00 2001 From: Andreas Auernhammer Date: Mon, 23 Oct 2023 17:46:29 +0200 Subject: [PATCH] review: fix bug in `api.Multicast.Add` We need to check that the added `io.Writer` is not nil. Signed-off-by: Andreas Auernhammer --- internal/api/multicast.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/multicast.go b/internal/api/multicast.go index b75276b6..2663484b 100644 --- a/internal/api/multicast.go +++ b/internal/api/multicast.go @@ -34,7 +34,7 @@ func (m *Multicast) Num() int { // Add adds w to m. Future writes to m will also reach w. // If w is already part of m, Add does nothing. func (m *Multicast) Add(w io.Writer) { - if m == nil { + if w == nil { return }