diff --git a/src/com/massivecraft/factions/entity/UPlayerColl.java b/src/com/massivecraft/factions/entity/UPlayerColl.java index 16ca7fa5..3d1af909 100644 --- a/src/com/massivecraft/factions/entity/UPlayerColl.java +++ b/src/com/massivecraft/factions/entity/UPlayerColl.java @@ -42,16 +42,19 @@ public class UPlayerColl extends SenderColl @Override public UPlayer detachId(Object oid) { - UPlayer ret = super.detachId(oid); + UPlayer ret = this.get(oid); if (ret == null) return null; // If inited ... - if (!this.inited()) return ret; - - // ... update the index. - Faction faction = ret.getFaction(); - faction.uplayers.remove(ret); + if (this.inited()) + { + // ... update the index. + Faction faction = ret.getFaction(); + faction.uplayers.remove(ret); + } + super.detachId(oid); + return ret; } diff --git a/src/com/massivecraft/factions/listeners/FactionsListenerEcon.java b/src/com/massivecraft/factions/listeners/FactionsListenerEcon.java index 175bcc19..b7f37a71 100644 --- a/src/com/massivecraft/factions/listeners/FactionsListenerEcon.java +++ b/src/com/massivecraft/factions/listeners/FactionsListenerEcon.java @@ -138,6 +138,7 @@ public class FactionsListenerEcon implements Listener } else if (event.getReason() == MembershipChangeReason.LEAVE) { + // TODO: NPE once occurred on line below. cost = UConf.get(event.getSender()).econCostLeave; desc = "leave a faction"; }