Skip to content

Commit

Permalink
fix the panic error in dashboard proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
TianxiangShen authored and tekton-robot committed Sep 10, 2024
1 parent 33e206b commit 7ac4ba5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/utils/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ func Proxy(request *http.Request, response http.ResponseWriter, url string, clie

if err != nil {
logging.Log.Errorf("Failed to execute request: %s", err)
return resp.StatusCode, err
if resp != nil {
return resp.StatusCode, err
}
// Return a generic status code if resp is nil
return http.StatusInternalServerError, err
}

for name, values := range resp.Header {
Expand Down

0 comments on commit 7ac4ba5

Please sign in to comment.