Skip to content

fix: prevent division by zero when pageSize is 0 or negative#8271

Open
appfast-codev wants to merge 1 commit intowenzhixin:developfrom
appfast-codev:fix/pageSize-div-zero
Open

fix: prevent division by zero when pageSize is 0 or negative#8271
appfast-codev wants to merge 1 commit intowenzhixin:developfrom
appfast-codev:fix/pageSize-div-zero

Conversation

@appfast-codev
Copy link
Copy Markdown

In initPagination, if pageSize is 0 or negative, the calculation ~~((totalRows - 1) / pageSize) + 1 causes a division by zero. Added a guard to treat pageSize <= 0 the same as 'show all rows', which sets pageSize to totalRows and allSelected to true. All 339 existing tests pass.

@wenzhixin
Copy link
Copy Markdown
Owner

Please provide an Online Example to show your problem. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants