mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-27 04:55:25 +01:00
Another null check
This commit is contained in:
parent
b0ec5b85c6
commit
5679a5b135
BIN
MobArena.jar
BIN
MobArena.jar
Binary file not shown.
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user