From c5850ddbd17b35af74c4bf675e3c01bd750d3843 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 1 May 2011 22:35:26 +0000 Subject: [PATCH] [trunk] Another fix for upgrading the home locations git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1302 e251c2fe-e539-e718-e476-b85c1f46cddb --- .../essentials/EssentialsUpgrade.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java index 8f582769e..7f9b5321f 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java @@ -197,19 +197,21 @@ public class EssentialsUpgrade { @SuppressWarnings("unchecked") List vals = (List)usersConfig.getProperty(username + ".home"); - World world = ess.getServer().getWorlds().get(0); - if (vals.size() > 5) - { - world = ess.getWorld((String)vals.get(5)); - } - if (world != null) - { - user.setHome(new Location(world, - ((Number)vals.get(0)).doubleValue(), - ((Number)vals.get(1)).doubleValue(), - ((Number)vals.get(2)).doubleValue(), - ((Number)vals.get(3)).floatValue(), - ((Number)vals.get(4)).floatValue()), true); + if (vals != null) { + World world = ess.getServer().getWorlds().get(0); + if (vals.size() > 5) + { + world = ess.getWorld((String)vals.get(5)); + } + if (world != null) + { + user.setHome(new Location(world, + ((Number)vals.get(0)).doubleValue(), + ((Number)vals.get(1)).doubleValue(), + ((Number)vals.get(2)).doubleValue(), + ((Number)vals.get(3)).floatValue(), + ((Number)vals.get(4)).floatValue()), true); + } } } }