mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00: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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(data.builds) == 0 || len(data.templates) == 0 {
|
||||||
|
httpapi.ResourceNotFound(rw)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
httpapi.Write(ctx, rw, http.StatusOK, convertWorkspace(
|
httpapi.Write(ctx, rw, http.StatusOK, convertWorkspace(
|
||||||
workspace,
|
workspace,
|
||||||
data.builds[0],
|
data.builds[0],
|
||||||
|
Reference in New Issue
Block a user