Skip to content

Commit 323fc19

Browse files
authored
[supervisor] Don't panic if connection is already closed (#18956)
1 parent c46f9bf commit 323fc19

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/gitpod-protocol/go/reconnecting-ws.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ func (rc *ReconnectingWebsocket) Dial(ctx context.Context) error {
166166
case connCh := <-rc.connCh:
167167
connCh <- conn
168168
case <-rc.errCh:
169-
conn.Close()
169+
if conn != nil {
170+
conn.Close()
171+
}
170172

171173
time.Sleep(1 * time.Second)
172174
conn = rc.connect(ctx)

0 commit comments

Comments
 (0)