Performs pagination bounds check. Fixes #1509 (#1754)

Adds pagination bounds check Fixes #1509
This commit is contained in:
Johnny Cao 2018-01-16 04:56:39 -08:00 committed by Ali 'SupaHam' M
parent 87c6672212
commit ef1e57f445

View file

@ -70,6 +70,10 @@ public class TextPager {
}
int pages = end / 9 + (end % 9 > 0 ? 1 : 0);
if (page > pages) {
sender.sendMessage(tl("infoUnknownChapter"));
return;
}
if (!onePage && commandName != null) {
StringBuilder content = new StringBuilder();