triumph-gui icon indicating copy to clipboard operation
triumph-gui copied to clipboard

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

Open IllusionTheDev opened this issue 1 year ago • 1 comments

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

IllusionTheDev avatar Aug 16 '23 05:08 IllusionTheDev

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

kazuryyx avatar Aug 16 '23 20:08 kazuryyx