Check nil error in IsProbableEOF()

pull/6/head
Zihong Zheng 2018-02-28 15:21:19 -08:00
parent 07240b7166
commit 59b878f3e0
1 changed files with 3 additions and 0 deletions

View File

@ -61,6 +61,9 @@ func JoinPreservingTrailingSlash(elem ...string) string {
// differentiate probable errors in connection behavior between normal "this is
// disconnected" should use the method.
func IsProbableEOF(err error) bool {
if err == nil {
return false
}
if uerr, ok := err.(*url.Error); ok {
err = uerr.Err
}