fix crash

pull/238/head
Shelikhoo 2016-08-14 20:41:26 +08:00
parent 5e576e11bb
commit fed2933043
No known key found for this signature in database
GPG Key ID: 7791BDB0709ABD21
1 changed files with 4 additions and 2 deletions

View File

@ -113,8 +113,10 @@ func wsDial(src v2net.Address, dest v2net.Destination) (*wsconn, error) {
conn, resp, err := dialer.Dial(uri, nil)
if err != nil {
reason, reasonerr := ioutil.ReadAll(resp.Body)
log.Info(string(reason), reasonerr)
if resp != nil {
reason, reasonerr := ioutil.ReadAll(resp.Body)
log.Info(string(reason), reasonerr)
}
return nil, err
}
return func() internet.Connection {