From 051f99498c4d4e98669aa76bc4c4a79e60239c10 Mon Sep 17 00:00:00 2001 From: BroodjeAap Date: Mon, 9 Jan 2023 10:03:14 +0000 Subject: [PATCH] template bounds check fix --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 4e90113..a716512 100644 --- a/main.go +++ b/main.go @@ -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