Skip to content

Commit 95d364f

Browse files
committed
fix: clamp MAX_PAGINATION_PAGES to minimum of 1
1 parent 1085d5a commit 95d364f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib/api-client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,10 @@ function extractLinkAttr(segment: string, attr: string): string | undefined {
405405
* covers even the largest organizations. Override with SENTRY_MAX_PAGINATION_PAGES
406406
* env var for edge cases.
407407
*/
408-
const MAX_PAGINATION_PAGES =
409-
Number(process.env.SENTRY_MAX_PAGINATION_PAGES) || 50;
408+
const MAX_PAGINATION_PAGES = Math.max(
409+
1,
410+
Number(process.env.SENTRY_MAX_PAGINATION_PAGES) || 50
411+
);
410412

411413
/**
412414
* Paginated API response with cursor metadata.

0 commit comments

Comments
 (0)