Skip to content

Commit 90901ca

Browse files
authored
fix: panic on deleted template (coder#6553)
1 parent 6023264 commit 90901ca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

coderd/workspaces.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ func (api *API) workspaceByOwnerAndName(rw http.ResponseWriter, r *http.Request)
256256
return
257257
}
258258

259+
if len(data.builds) == 0 || len(data.templates) == 0 {
260+
httpapi.ResourceNotFound(rw)
261+
return
262+
}
263+
259264
httpapi.Write(ctx, rw, http.StatusOK, convertWorkspace(
260265
workspace,
261266
data.builds[0],

0 commit comments

Comments
 (0)