triumph-gui
triumph-gui copied to clipboard
PaginatedGui#getPagesNum returns Integer.MAX_VALUE when optional field is not set
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:
I noticed this too, players could infinitely click on the next button even if there was no page at the next index.