Possible fix for IndexOutOfBoundsException in getPageElements

This commit is contained in:
NichtStudioCode 2021-10-20 23:07:20 +02:00
parent 0b96a820ec
commit 4d79d6eb7e

@ -64,7 +64,7 @@ public abstract class PagedGUI extends BaseGUI {
if (currentPage == 0 || infinitePages) return; if (currentPage == 0 || infinitePages) return;
int pageAmount = getPageAmount(); int pageAmount = getPageAmount();
if (currentPage < 0) currentPage = 0; if (currentPage < 0 || pageAmount <= 0) currentPage = 0;
else if (currentPage >= pageAmount) currentPage = pageAmount - 1; else if (currentPage >= pageAmount) currentPage = pageAmount - 1;
} }