Skip to content

Commit

Permalink
Add null check
Browse files Browse the repository at this point in the history
* Adds null checks for the ITab Inventory when it comes to shield mod extension
  • Loading branch information
ViralReaction committed Sep 8, 2024
1 parent 818678d commit 4d13ca0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,8 @@ private void RebuildArmorCache(Dictionary<BodyPartRecord, float> armorCache, Sta
}
if (shield != null)
{
var shieldCoverage = shield.def.GetModExtension<ShieldDefExtension>().PartIsCoveredByShield(part, SelPawnForGear);
if (shieldCoverage)
var shieldCoverage = shield.def?.GetModExtension<ShieldDefExtension>()?.PartIsCoveredByShield(part, SelPawnForGear);
if (shieldCoverage == true)
{
armorValue += shield.GetStatValue(stat);
}
Expand Down

0 comments on commit 4d13ca0

Please sign in to comment.