diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/Hero.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/Hero.java index 54b2509..517e1b7 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/Hero.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/Hero.java @@ -127,7 +127,6 @@ public class Hero extends MongoBase implements Cloneable, Serializable { combatPlanMap = new HashMap<>(2); medalMap = new HashMap<>(4); this.adjustByPositionMap = hero.adjustByPositionMap; - this.heroGiftEquipList = new HashSet<>(hero.getHeroGiftEquipList()); } public Hero(int uid, int heroTid, int initStar) { @@ -661,6 +660,9 @@ public class Hero extends MongoBase implements Cloneable, Serializable { } public void setHeroGiftEquipList(Set heroGiftEquipList) { + if(heroGiftEquipList == null){ + heroGiftEquipList = new HashSet<>(); + } this.heroGiftEquipList = heroGiftEquipList; updateString("heroGiftEquipList", heroGiftEquipList); } @@ -671,6 +673,9 @@ public class Hero extends MongoBase implements Cloneable, Serializable { } public Set getHeroGiftEquipList() { + if(this.heroGiftEquipList == null){ + this.heroGiftEquipList = new HashSet<>(); + } return heroGiftEquipList; } }