Skip to content

Commit 49c17de

Browse files
authored
fix: An emoty string nextMarker should be treated as end-of-paging. (#893)
1 parent ffff13c commit 49c17de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/Network/PagingIterator.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ public class PagingIterator<Element: BoxModel> {
9494
nextPage = .streamPosition(nextStreamPosition)
9595
}
9696
// Handle marker based paging
97-
else if let nextPageMarker = page.nextMarker {
97+
// An Empty string, like a nil `nextMarker`, indicates the end has been reached.
98+
// ref: https://developer.box.com/guides/api-calls/pagination/marker-based/
99+
else if let nextPageMarker = page.nextMarker, !nextPageMarker.isEmpty {
98100
nextPage = .marker(nextPageMarker)
99101
}
100102
// Handle unexpected value with no paging information

0 commit comments

Comments
 (0)