From 6523caa908814f933ff6b5ca785b90d724d36b1e Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Thu, 7 Mar 2019 21:35:58 +0100 Subject: [PATCH] Fix command sign exception; resolves #544 --- src/main/java/de/erethon/dungeonsxl/sign/CommandSign.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/erethon/dungeonsxl/sign/CommandSign.java b/src/main/java/de/erethon/dungeonsxl/sign/CommandSign.java index c84ba735..91196178 100644 --- a/src/main/java/de/erethon/dungeonsxl/sign/CommandSign.java +++ b/src/main/java/de/erethon/dungeonsxl/sign/CommandSign.java @@ -72,7 +72,9 @@ public class CommandSign extends DSign { command = lines[1]; delay = NumberUtil.parseInt(attributes[0]); - executor = attributes[1]; + if (attributes.length >= 2) { + executor = attributes[1]; + } cCommand = CommandsXL.getPlugin().getCCommands().getCCommand(command); @@ -98,10 +100,10 @@ public class CommandSign extends DSign { @Override public boolean onPlayerTrigger(final Player player) { - if (executor.equalsIgnoreCase("Console")) { + if ("Console".equalsIgnoreCase(executor)) { new CCommandExecutorTask(player, cCommand, Bukkit.getConsoleSender(), true).runTaskLater(plugin, delay * 20); - } else if (executor.equalsIgnoreCase("OP")) { + } else if ("OP".equalsIgnoreCase(executor)) { boolean isOp = player.isOp(); player.setOp(true);