Fix possible NPE.

This commit is contained in:
Andreas Troelsen 2013-01-26 03:47:07 +01:00
parent fa28964d51
commit 646a31da73

View File

@ -996,13 +996,13 @@ public class ArenaImpl implements Arena
for (int i = contents.length-1; i > contents.length-5; i--) { for (int i = contents.length-1; i > contents.length-5; i--) {
if (contents[i] == null) continue; if (contents[i] == null) continue;
ArmorType type = ArmorType.getType(contents[i]); ArmorType type = ArmorType.getType(contents[i]);
if (type == null) continue;
switch (type) { switch (type) {
case HELMET: inv.setHelmet(contents[i]); break; case HELMET: inv.setHelmet(contents[i]); break;
case CHESTPLATE: inv.setChestplate(contents[i]); break; case CHESTPLATE: inv.setChestplate(contents[i]); break;
case LEGGINGS: inv.setLeggings(contents[i]); break; case LEGGINGS: inv.setLeggings(contents[i]); break;
case BOOTS: inv.setBoots(contents[i]); break; case BOOTS: inv.setBoots(contents[i]); break;
default:
continue;
} }
contents[i] = null; contents[i] = null;
} }