mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
bug: fix possible nil pointer derefrence in test
This commit is contained in:
parent
ac917aa36a
commit
5a48eee611
@ -43,6 +43,7 @@ func expectHTTP(url string, code int, t *testing.T) {
|
|||||||
r, err := http.Get(url)
|
r, err := http.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("unexpected error: %v", err)
|
t.Errorf("unexpected error: %v", err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if r.StatusCode != code {
|
if r.StatusCode != code {
|
||||||
t.Errorf("unexpected response: %v", r.StatusCode)
|
t.Errorf("unexpected response: %v", r.StatusCode)
|
||||||
|
Loading…
Reference in New Issue
Block a user