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

Binary file not shown.

View File

@ -809,7 +809,7 @@ public class Arena
{
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;
w.setOwner(null);

View File

@ -391,6 +391,11 @@ public class MAUtils
{
// Grab the items from the MobArena .inv file
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 (!p.isOnline())
@ -439,7 +444,7 @@ public class MAUtils
catch (Exception e)
{
e.printStackTrace();
MobArena.warning("Could not restore inventory for " + p.getName());
MobArena.warning("Could not get inventory file for '" + p.getName() + "'");
return null;
}
}