NPE fix for offline users in UserData

That one was correct, otherwise the inventory will be deleted by offline changes.

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1585 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-06-05 00:03:44 +00:00
parent 1751baeed6
commit bc3d8d5ece

View file

@ -324,7 +324,7 @@ public abstract class UserData extends PlayerExtension implements IConf
private ItemStack[] _getSavedInventory()
{
int size = config.getInt("inventory.size", 0);
if (getInventory() == null || size < 1 || size > getInventory().getSize())
if (getInventory() != null && (size < 1 || size > getInventory().getSize()))
{
return null;
}