Avoid NPE

This commit is contained in:
Magnus Ulf 2019-02-09 16:57:05 +01:00
parent d6ec4ad5f0
commit 38a0b93cc3

View File

@ -66,10 +66,13 @@ public class TypeFaction extends TypeAbstract<Faction>
// MPlayer Name Exact
String id = IdUtil.getId(str);
MPlayer mplayer = MPlayerColl.get().get(id, false);
if (mplayer != null)
if (id != null)
{
return mplayer.getFaction();
MPlayer mplayer = MPlayerColl.get().get(id, false);
if (mplayer != null)
{
return mplayer.getFaction();
}
}
throw new MassiveException().addMsg("<b>No faction or player matching \"<p>%s<b>\".", str);