diff --git a/src/main/java/com/massivecraft/massivecore/store/Coll.java b/src/main/java/com/massivecraft/massivecore/store/Coll.java index 72d6da46..7e873562 100644 --- a/src/main/java/com/massivecraft/massivecore/store/Coll.java +++ b/src/main/java/com/massivecraft/massivecore/store/Coll.java @@ -149,7 +149,7 @@ public class Coll implements CollInterface if (oid == null) return null; String ret = null; - if (oid instanceof String) + if (oid instanceof String) { ret = (String)oid; } diff --git a/src/main/java/com/massivecraft/massivecore/store/SenderColl.java b/src/main/java/com/massivecraft/massivecore/store/SenderColl.java index 40fa87ee..b44b017f 100644 --- a/src/main/java/com/massivecraft/massivecore/store/SenderColl.java +++ b/src/main/java/com/massivecraft/massivecore/store/SenderColl.java @@ -41,20 +41,36 @@ public class SenderColl> extends Coll implements Se @Override public String fixId(Object oid) { + // A null oid should always return null. if (oid == null) return null; - if (oid instanceof String) + String ret = null; + + if (oid instanceof String) { - String ret = (String)oid; - return this.isLowercasing() ? ret.toLowerCase() : ret; + ret = (String)oid; + } + else if (oid.getClass() == this.entityClass) + { + ret = this.entity2id.get(oid); } - if (oid.getClass() == this.entityClass) + if (ret == null) { - return fixId(this.entity2id.get(oid)); + ret = IdUtil.getId(oid); } - return fixId(IdUtil.getId(oid)); + if (ret == null) + { + return null; + } + + if (this.isLowercasing()) + { + ret = ret.toLowerCase(); + } + + return ret; } // -------------------------------------------- //