From 6c78bee5c130292d76595ce002a161239586222f Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 3 Sep 2023 19:24:06 -0500 Subject: [PATCH] null check --- src/engine/objects/Mob.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 9b35aef8..73bdcabe 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1706,12 +1706,16 @@ public class Mob extends AbstractIntelligenceAgent { this.deathTime = 0; if(PowersManager._allRuneSkillAdjusts.containsKey(this.getMobBaseID())) - for(RuneSkillAdjustEntry entry : PowersManager._allRuneSkillAdjusts.get(this.getMobBaseID())) - if(entry.level <= this.level) - if(this.skills.containsKey(entry.name) == false) - this.skills.put(entry.skill_type,new CharacterSkill(SkillsBase.getFromCache(entry.token),this,entry.rank)); - else - this.skills.put(entry.skill_type,new CharacterSkill(SkillsBase.getFromCache(entry.token),this,entry.rank + this.skills.get(entry.skill_type).getNumTrains())); + for(RuneSkillAdjustEntry entry : PowersManager._allRuneSkillAdjusts.get(this.getMobBaseID())) { + SkillsBase skillBase = SkillsBase.getFromCache(entry.token); + if(skillBase == null) + continue; + if (entry.level <= this.level) + if (this.skills.containsKey(entry.name) == false) + this.skills.put(entry.skill_type, new CharacterSkill(skillBase, this, entry.rank)); + else + this.skills.put(entry.skill_type, new CharacterSkill(skillBase, this, entry.rank + this.skills.get(entry.skill_type).getNumTrains())); + } } @Override