Fix body close

This commit is contained in:
Zoltan Papp 2024-07-08 21:55:03 +02:00
parent c3e8187a47
commit 2d7e797e08

View File

@ -28,8 +28,9 @@ func Dial(address string) (net.Conn, error) {
log.Errorf("failed to dial to Relay server '%s': %s", wsURL, err) log.Errorf("failed to dial to Relay server '%s': %s", wsURL, err)
return nil, err return nil, err
} }
_ = resp.Body.Close() if resp.Body != nil {
_ = resp.Body.Close()
}
conn := NewConn(wsConn) conn := NewConn(wsConn)
return conn, nil return conn, nil
} }