fix index out of bounds error
diff --git a/pagination/pager.go b/pagination/pager.go
index ea47c69..a7593ac 100644
--- a/pagination/pager.go
+++ b/pagination/pager.go
@@ -174,8 +174,10 @@
if err != nil {
return nil, err
}
- // Remove the trailing comma.
- pagesSlice = pagesSlice[:len(pagesSlice)-1]
+ if len(pagesSlice) > 0 {
+ // Remove the trailing comma.
+ pagesSlice = pagesSlice[:len(pagesSlice)-1]
+ }
var b []byte
// Combine the slice of slices in to a single slice.
for _, slice := range pagesSlice {