File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ func (r *Page[T]) UnmarshalJSON(data []byte) error {
4343// there is no next page, this function will return a 'nil' for the page value, but
4444// will not return an error
4545func (r * Page [T ]) GetNextPage () (res * Page [T ], err error ) {
46+ if len (r .Data ) == 0 {
47+ return nil , nil
48+ }
4649 // This page represents a response that isn't actually paginated at the API level
4750 // so there will never be a next page.
4851 cfg := (* requestconfig .RequestConfig )(nil )
@@ -137,6 +140,10 @@ func (r *CursorPage[T]) UnmarshalJSON(data []byte) error {
137140// there is no next page, this function will return a 'nil' for the page value, but
138141// will not return an error
139142func (r * CursorPage [T ]) GetNextPage () (res * CursorPage [T ], err error ) {
143+ if len (r .Data ) == 0 {
144+ return nil , nil
145+ }
146+
140147 if r .JSON .HasMore .Valid () && r .HasMore == false {
141148 return nil , nil
142149 }
You can’t perform that action at this time.
0 commit comments