From 9d5ba1422c05d40107b2bb1fcb51e82ca972691c Mon Sep 17 00:00:00 2001 From: Lycaonj Date: Fri, 29 Jul 2011 05:15:09 -0500 Subject: [PATCH] Added check to avoid showing a region list premessage if there are no regions to show. --- TShockAPI/Commands.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 230add18..5cfd8cb0 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1651,6 +1651,13 @@ namespace TShockAPI var regions = TShock.Regions.ListAllRegions(Main.worldID.ToString()); + // Are there even any regions to display? + if (regions.Count == 0) + { + args.Player.SendMessage("There are currently no regions defined.", Color.Red); + return; + } + //Check if they are trying to access a page that doesn't exist. int pagecount = regions.Count / pagelimit; if (page > pagecount)