From c40c9c40448374a917a06f90885e68dfab38633b Mon Sep 17 00:00:00 2001 From: BONNe Date: Tue, 18 Dec 2018 00:41:56 +0200 Subject: [PATCH] Fix crash reported in #24. GUI will be opened only if caller is player. --- src/main/java/world/bentobox/level/commands/IslandTop.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/level/commands/IslandTop.java b/src/main/java/world/bentobox/level/commands/IslandTop.java index aec6312..d484511 100644 --- a/src/main/java/world/bentobox/level/commands/IslandTop.java +++ b/src/main/java/world/bentobox/level/commands/IslandTop.java @@ -17,7 +17,9 @@ public class IslandTop extends CompositeCommand { @Override public boolean execute(User user, String label, List list) { - plugin.getTopTen().getGUI(getWorld(), user, getPermissionPrefix()); + if (user.isPlayer()) { + this.plugin.getTopTen().getGUI(getWorld(), user, getPermissionPrefix()); + } return true; }