1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 07:39:43 +02:00

edge case detection for page numbering logic

This commit is contained in:
Harvey Kandola 2017-12-20 11:49:09 +00:00
parent ebdaa9529c
commit d0f28daa7c

View file

@ -43,7 +43,12 @@ func Numberize(pages []Page) {
end = uint64(len(parts))
}
parts = parts[0 : len(parts)-int(end)]
parts[len(parts)-1]++
i := len(parts) - 1
if i < 0 {
i = 0
}
parts[i]++
}
}