Skip to content

Commit 07ba0bc

Browse files
committed
Fix panic in conversion webhook
1 parent c83076e commit 07ba0bc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/webhook/conversion/conversion.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ func (wh *Webhook) ServeHTTP(w http.ResponseWriter, r *http.Request) {
6969
return
7070
}
7171

72+
if convertReview.Request == nil {
73+
log.Error(nil, "conversion request is nil")
74+
w.WriteHeader(http.StatusBadRequest)
75+
return
76+
}
77+
7278
// TODO(droot): may be move the conversion logic to a separate module to
7379
// decouple it from the http layer ?
7480
resp, err := wh.handleConvertRequest(convertReview.Request)

0 commit comments

Comments
 (0)