Skip to content

Commit

Permalink
Crash Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DelnarErsike committed Nov 30, 2022
1 parent 1f5c1fd commit 3b91117
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Chummer/Backend/Equipment/Weapon.cs
Expand Up @@ -6184,15 +6184,20 @@ private Skill Skill
strSkill = UseSkill;
strSpec = string.Empty;

if (ExoticSkill.IsExoticSkillName(_objCharacter, UseSkill))
(bool blnIsExotic, string strSkillName)
= ExoticSkill.IsExoticSkillNameTuple(_objCharacter, UseSkill);
if (blnIsExotic)
{
strSkill = strSkillName;
strSpec = UseSkillSpec;
}
}

// Locate the Active Skill to be used.
Skill objSkill = _objCharacter.SkillsSection.GetActiveSkill(strSkill);
if (string.IsNullOrEmpty(strSpec) || objSkill.HasSpecialization(strSpec)
|| objSkill.HasSpecialization(Name) || (!string.IsNullOrEmpty(Spec2)
&& objSkill.HasSpecialization(Spec2)))
if (string.IsNullOrEmpty(strSpec) || objSkill == null || objSkill.HasSpecialization(strSpec)
|| objSkill.HasSpecialization(Name)
|| (!string.IsNullOrEmpty(Spec2) && objSkill.HasSpecialization(Spec2)))
return objSkill;
return null;
}
Expand Down

0 comments on commit 3b91117

Please sign in to comment.