Another null check

This commit is contained in:
Garbage Mule
2011-09-25 15:27:28 +02:00
parent b0ec5b85c6
commit 5679a5b135
3 changed files with 7 additions and 2 deletions
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -809,7 +809,7 @@ public class Arena
{ {
for (Wolf w : pets) for (Wolf w : pets)
{ {
if (w == null || !((Player) w.getOwner()).getName().equals(p.getName())) if (w == null || !(w.getOwner() instanceof Player) || !((Player) w.getOwner()).getName().equals(p.getName()))
continue; continue;
w.setOwner(null); w.setOwner(null);
+6 -1
View File
@@ -391,6 +391,11 @@ public class MAUtils
{ {
// Grab the items from the MobArena .inv file // Grab the items from the MobArena .inv file
ItemStack[] stacks = getInventoryFile(p); ItemStack[] stacks = getInventoryFile(p);
if (stacks == null)
{
MobArena.warning("Couldn't restore player inventory for '" + p.getName() + "'");
return false;
}
// If the player isn't online, hack the playerName.dat file // If the player isn't online, hack the playerName.dat file
if (!p.isOnline()) if (!p.isOnline())
@@ -439,7 +444,7 @@ public class MAUtils
catch (Exception e) catch (Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
MobArena.warning("Could not restore inventory for " + p.getName()); MobArena.warning("Could not get inventory file for '" + p.getName() + "'");
return null; return null;
} }
} }