mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: panic on deleted template (#6553)
This commit is contained in:
@@ -256,6 +256,11 @@ func (api *API) workspaceByOwnerAndName(rw http.ResponseWriter, r *http.Request)
|
||||
return
|
||||
}
|
||||
|
||||
if len(data.builds) == 0 || len(data.templates) == 0 {
|
||||
httpapi.ResourceNotFound(rw)
|
||||
return
|
||||
}
|
||||
|
||||
httpapi.Write(ctx, rw, http.StatusOK, convertWorkspace(
|
||||
workspace,
|
||||
data.builds[0],
|
||||
|
||||
Reference in New Issue
Block a user