Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PaginatedGui#getPagesNum returns Integer.MAX_VALUE when optional field is not set #100

Open
IllusionTheDev opened this issue Aug 16, 2023 · 1 comment

Comments

@IllusionTheDev
Copy link

Hey there, no clue if this is a design flaw.

There's an optional field named pageSize in the PaginatedGui class, with an optional setter.
When the value is unset (0), and getPagesNum is called, there is a division by 0, which gets casted to an int returning MAX_VALUE.

Code in question: image

@kazuryyx
Copy link

I noticed this too, players could infinitely click on the next button even if there was no page at the next index.

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

No branches or pull requests

2 participants