From 59a7f4f80e2e6b3abd416995ac4630a0876b10db Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sun, 10 Feb 2013 03:56:00 +0100 Subject: [PATCH] Fixed index out of bounds exception. --- src/de/craftinc/gates/commands/BaseCommand.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/de/craftinc/gates/commands/BaseCommand.java b/src/de/craftinc/gates/commands/BaseCommand.java index d74b00e..6c9bd1a 100644 --- a/src/de/craftinc/gates/commands/BaseCommand.java +++ b/src/de/craftinc/gates/commands/BaseCommand.java @@ -82,7 +82,7 @@ public abstract class BaseCommand { boolean allParamtertersThere = parameters.size() < requiredParameters.size(); boolean senderIsPlayer = this.sender instanceof Player; - boolean parameterIsGate = this.getGateForParamater(this.parameters.get(0)); + boolean parameterIsGate = this.parameters.size() > 0 ? this.getGateForParamater(this.parameters.get(0)) : false; boolean senderHasPermission; try { @@ -188,6 +188,11 @@ public abstract class BaseCommand throw new Exception("Cannot check permissons with no gate provided!"); } + System.out.println("************"); + System.out.println(this.gate.getLocation().getWorld()); + System.out.println(this.gate.getExit().getWorld()); + System.out.println("************"); + boolean permAtLocation = Plugin.permission.has(this.gate.getLocation().getWorld(), player.getName(), this.requiredPermission); boolean permAtExit = Plugin.permission.has(this.gate.getExit().getWorld(), player.getName(), this.requiredPermission);