From 59b878f3e09a3872dd2622a8a569f04b97d51eb9 Mon Sep 17 00:00:00 2001 From: Zihong Zheng Date: Wed, 28 Feb 2018 15:21:19 -0800 Subject: [PATCH] Check nil error in IsProbableEOF() --- staging/src/k8s.io/apimachinery/pkg/util/net/http.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/staging/src/k8s.io/apimachinery/pkg/util/net/http.go b/staging/src/k8s.io/apimachinery/pkg/util/net/http.go index bc2a531b9d2..76eb8b4fa22 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/net/http.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/net/http.go @@ -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 }