Avoid NPE

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

View File

@ -66,11 +66,14 @@ public class TypeFaction extends TypeAbstract<Faction>
// MPlayer Name Exact
String id = IdUtil.getId(str);
if (id != null)
{
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);
}