From 442bbd11399a1a6cfb0daa424e17e6bc590aefec Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Fri, 5 Dec 2014 00:34:48 +0100 Subject: [PATCH] We might have the special faction id but not the faction on update. Probably Fixes #722. --- .../com/massivecraft/factions/update/UpdateUtil.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/update/UpdateUtil.java b/src/main/java/com/massivecraft/factions/update/UpdateUtil.java index f51281cb..0183df5f 100644 --- a/src/main/java/com/massivecraft/factions/update/UpdateUtil.java +++ b/src/main/java/com/massivecraft/factions/update/UpdateUtil.java @@ -159,15 +159,16 @@ public class UpdateUtil // Get the coll. FactionColl coll = FactionColl.get(); + // Get the faction and detach it + Faction faction = coll.detachId(from); + if (faction == null) return; + coll.syncId(from); + // A faction may already be occupying the to-id. // We must remove it to make space for renaming. // This faction is simply an auto-created faction with no references yet. coll.detachId(to); coll.syncId(to); - - // Get the faction and detach it - Faction faction = coll.detachId(from); - coll.syncId(from); // Attach it coll.attach(faction, to);