From b8a3395d1dc32ce6d1c6a72c95850e3bf702ba5e Mon Sep 17 00:00:00 2001 From: boy0001 Date: Tue, 12 May 2015 01:48:22 +1000 Subject: [PATCH] Fixed empty inbox --- .../java/com/intellectualcrafters/plot/commands/Inbox.java | 4 ++++ .../src/main/java/com/intellectualcrafters/plot/config/C.java | 1 + 2 files changed, 5 insertions(+) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java index c4e274004..35808f640 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Inbox.java @@ -40,6 +40,10 @@ public class Inbox extends SubCommand { } public void displayComments(PlotPlayer player, List oldComments, int page) { + if (oldComments == null || oldComments.size() == 0) { + MainUtil.sendMessage(player, C.INBOX_EMPTY); + return; + } PlotComment[] comments = oldComments.toArray(new PlotComment[oldComments.size()]); if (page < 0) { page = 0; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java index 1e0e3cb33..f33e10a96 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java @@ -119,6 +119,7 @@ public enum C { COMMENT_REMOVED("$4Successfully deleted comment/s:n$2 - '$3%s$2'", "Comment"), COMMENT_ADDED("$4A comment has been left", "Comment"), COMMENT_HEADER("$2====== Comments ======", "Comment"), + INBOX_EMPTY("$2No comments","Comment"), /* * Console */