diff --git a/listener.go b/listener.go index 66fcd99..70f5083 100644 --- a/listener.go +++ b/listener.go @@ -37,6 +37,11 @@ func unwatchPubKey(excludedKey string, ws *websocket.Conn) { if existingWs == ws { continue } + if i == len(wss) { + // if we reach this point it is because the key we were + // excluding wasn't here in the first place + return + } newWss[i] = existingWs i++ }