From 094bb13cf3c3636f85e5d371877ba4b765f013e1 Mon Sep 17 00:00:00 2001 From: Seednode Date: Sat, 17 Sep 2022 12:42:25 -0500 Subject: [PATCH] Added slice length check --- cmd/files.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/files.go b/cmd/files.go index 2c27b97..3e67d78 100644 --- a/cmd/files.go +++ b/cmd/files.go @@ -22,10 +22,14 @@ func getNextFile(path string) (string, error) { split := re.FindAllStringSubmatch(path, -1) + if len(split[0]) < 3 { + return "", nil + } + base := split[0][1] number, err := strconv.Atoi(split[0][2]) if err != nil { - return "", nil + return "", err } extension := split[0][3]