From 38a0b93cc3681c687480e8171069343ea7331aba Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Sat, 9 Feb 2019 16:57:05 +0100 Subject: [PATCH] Avoid NPE --- src/com/massivecraft/factions/cmd/type/TypeFaction.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/type/TypeFaction.java b/src/com/massivecraft/factions/cmd/type/TypeFaction.java index d1c96fd9..e6c33bf6 100644 --- a/src/com/massivecraft/factions/cmd/type/TypeFaction.java +++ b/src/com/massivecraft/factions/cmd/type/TypeFaction.java @@ -66,10 +66,13 @@ public class TypeFaction extends TypeAbstract // 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("No faction or player matching \"

%s\".", str);