From aa7415a1515758b2d171dda7ca7a5134d5eaad0a Mon Sep 17 00:00:00 2001 From: Xephi Date: Wed, 6 Aug 2014 17:35:47 +0200 Subject: [PATCH] Fix ArrayOutOfBoundsException with spawn priority --- src/main/java/fr/xephi/authme/AuthMe.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index 34990d797..9e8b5eafd 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -699,6 +699,11 @@ public class AuthMe extends JavaPlugin { public Location getSpawnLocation(Player player) { World world = player.getWorld(); String[] spawnPriority = Settings.spawnPriority.split(","); + if (spawnPriority.length < 4) { + ConsoleLogger.showError("Check your config for spawnPriority, you need to put all of 4 spawn priorities"); + ConsoleLogger.showError("Defaulting Spawn to world's one"); + return world.getSpawnLocation(); + } Location spawnLoc = world.getSpawnLocation(); int i = 3; for (i = 3 ; i >= 0 ; i--) {