From 9e4cc676ead6caa34c7c6893d45856bd26fdfc1d Mon Sep 17 00:00:00 2001 From: Brettflan Date: Fri, 30 Nov 2012 19:43:01 -0600 Subject: [PATCH] fix for /f list command throwing an error if an invalid page number was specified (ex. 5 pages available and they run /f list 6) --- src/com/massivecraft/factions/cmd/CmdList.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/massivecraft/factions/cmd/CmdList.java b/src/com/massivecraft/factions/cmd/CmdList.java index 5819ee1e..eed64c06 100644 --- a/src/com/massivecraft/factions/cmd/CmdList.java +++ b/src/com/massivecraft/factions/cmd/CmdList.java @@ -94,6 +94,10 @@ public class CmdList extends FCommand final int pageheight = 9; int pagenumber = this.argAsInt(0, 1); int pagecount = (factionList.size() / pageheight) + 1; + if (pagenumber > pagecount) + pagenumber = pagecount; + else if (pagenumber < 1) + pagenumber = 1; int start = (pagenumber - 1) * pageheight; int end = start + pageheight; if (end > factionList.size())