Merge pull request #70 from yggdrasil-network/urlfix

Default to previous scheme when url.Parse returns an error
This commit is contained in:
Neil Alexander 2018-04-27 10:26:04 +01:00 committed by GitHub
commit cf2e112ae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -313,10 +313,7 @@ func (c *Core) DEBUG_maybeSendUDPKeys(saddr string) {
func (c *Core) DEBUG_addPeer(addr string) { func (c *Core) DEBUG_addPeer(addr string) {
u, err := url.Parse(addr) u, err := url.Parse(addr)
if err != nil { if err == nil {
panic(err)
}
if len(u.Opaque) == 0 {
switch strings.ToLower(u.Scheme) { switch strings.ToLower(u.Scheme) {
case "tcp": case "tcp":
c.DEBUG_addTCPConn(u.Host) c.DEBUG_addTCPConn(u.Host)