Added slice length check

This commit is contained in:
Seednode 2022-09-17 12:42:25 -05:00
parent d6aa587091
commit 094bb13cf3
1 changed files with 5 additions and 1 deletions

View File

@ -22,10 +22,14 @@ func getNextFile(path string) (string, error) {
split := re.FindAllStringSubmatch(path, -1) split := re.FindAllStringSubmatch(path, -1)
if len(split[0]) < 3 {
return "", nil
}
base := split[0][1] base := split[0][1]
number, err := strconv.Atoi(split[0][2]) number, err := strconv.Atoi(split[0][2])
if err != nil { if err != nil {
return "", nil return "", err
} }
extension := split[0][3] extension := split[0][3]