fixed bug in last commit

This commit is contained in:
z1glr
2025-04-19 20:00:08 +00:00
parent 9743632ecb
commit f1d2a7f33f

View File

@@ -137,7 +137,7 @@ func init() {
path := c.Path() path := c.Path()
// if it is for the api, don't try to add the html extension // if it is for the api, don't try to add the html extension
if path[1:4] != "dev" { if len(path) < 4 || path[1:4] != "dev" {
// check, wether a html-file exists for the path // check, wether a html-file exists for the path
if _, err := os.Stat(filepath.Join("html", path)); errors.Is(err, os.ErrNotExist) { if _, err := os.Stat(filepath.Join("html", path)); errors.Is(err, os.ErrNotExist) {
htmlPath := path + ".html" htmlPath := path + ".html"