From 646a31da731d3eb7e4b81cae90250f56af768bbb Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Sat, 26 Jan 2013 03:47:07 +0100 Subject: [PATCH] Fix possible NPE. --- src/com/garbagemule/MobArena/ArenaImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/garbagemule/MobArena/ArenaImpl.java b/src/com/garbagemule/MobArena/ArenaImpl.java index a3554ca..b1a8136 100644 --- a/src/com/garbagemule/MobArena/ArenaImpl.java +++ b/src/com/garbagemule/MobArena/ArenaImpl.java @@ -996,13 +996,13 @@ public class ArenaImpl implements Arena for (int i = contents.length-1; i > contents.length-5; i--) { if (contents[i] == null) continue; ArmorType type = ArmorType.getType(contents[i]); + if (type == null) continue; + switch (type) { case HELMET: inv.setHelmet(contents[i]); break; case CHESTPLATE: inv.setChestplate(contents[i]); break; case LEGGINGS: inv.setLeggings(contents[i]); break; case BOOTS: inv.setBoots(contents[i]); break; - default: - continue; } contents[i] = null; }