mirror of https://github.com/coder/coder.git
fix(coderd): prevent nil err deref (#12475)
This commit is contained in:
parent
dc69341583
commit
0647ec1960
|
@ -175,7 +175,6 @@ func (api *API) fileByID(rw http.ResponseWriter, r *http.Request) {
|
||||||
if file.Mimetype != codersdk.ContentTypeTar {
|
if file.Mimetype != codersdk.ContentTypeTar {
|
||||||
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
|
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
|
||||||
Message: "Only .tar files can be converted to .zip format",
|
Message: "Only .tar files can be converted to .zip format",
|
||||||
Detail: err.Error(),
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -192,7 +191,6 @@ func (api *API) fileByID(rw http.ResponseWriter, r *http.Request) {
|
||||||
default:
|
default:
|
||||||
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
|
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
|
||||||
Message: "Unsupported conversion format.",
|
Message: "Unsupported conversion format.",
|
||||||
Detail: err.Error(),
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue