template bounds check fix

This commit is contained in:
BroodjeAap 2023-01-09 10:03:14 +00:00
parent 4239128398
commit 051f99498c

View file

@ -392,7 +392,7 @@ func (web *Web) watchCreatePost(c *gin.Context) {
log.Fatalln("Could not load templates from embed FS")
}
if templateID >= len(templateFiles) {
if templateID > len(templateFiles) {
log.Println("/watch/create POSTed with", templateID, "but only", len(templateFiles), "templates")
c.AbortWithError(http.StatusBadRequest, err)
return