Fix null pointer in Avatar if skill level map didnt already contain skill id

This commit is contained in:
Melledy 2022-08-21 22:20:54 -07:00
parent 1e649cd804
commit 513924af7c
No known key found for this signature in database
GPG Key ID: 2A8E7A1D64737CCB

View File

@ -302,7 +302,7 @@ public class Avatar {
public Map<Integer, Integer> getSkillLevelMap() { // Returns a copy of the skill levels for the current skillDepot.
var map = new Int2IntOpenHashMap();
this.skillDepot.getSkillsAndEnergySkill()
.forEach(skillId -> map.computeIfAbsent(skillId, this.skillLevelMap::get));
.forEach(skillId -> map.put(skillId, this.skillLevelMap.computeIfAbsent(skillId, id -> 1).intValue()));
return map;
}