Fixed index out of bounds exception.
This commit is contained in:
parent
58695cadd3
commit
59a7f4f80e
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user