Another null check
This commit is contained in:
Binary file not shown.
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user