Avoid NPE

This commit is contained in:
Magnus Ulf 2019-02-10 19:21:46 +01:00
parent c1ef7eda9e
commit ad2131491b
2 changed files with 4 additions and 2 deletions

View File

@ -252,6 +252,7 @@ public class MoneyMixinVault extends MoneyMixinAbstract
public static Object getEconomyObject(String accountId)
{
if (null == accountId) return null;
// Because of Factions we have this crazy-workaround.
// Where offlineplayers will be used when possible
// but otherwise names will.

View File

@ -70,7 +70,6 @@ public class SenderColl<E extends SenderEntity<E>> extends Coll<E> implements Se
@Override
public String fixId(Object oid)
{
// A null oid should always return null.
if (oid == null) throw new NullPointerException("oid");
String ret = null;
@ -87,9 +86,11 @@ public class SenderColl<E extends SenderEntity<E>> extends Coll<E> implements Se
if (ret == null)
{
// Always lower case.
return IdUtil.getId(oid);
ret = IdUtil.getId(oid);
}
if (ret == null) throw new NullPointerException("Could not fix: " + oid);
if (this.isLowercasing())
{
ret = ret.toLowerCase();