From 857892738f4077e1421b5864161a421cf997fd59 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Fri, 30 Nov 2012 19:43:04 -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 edcd1f27..103c4a83 100644 --- a/src/com/massivecraft/factions/cmd/CmdList.java +++ b/src/com/massivecraft/factions/cmd/CmdList.java @@ -96,6 +96,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())