Skip to content

Commit

Permalink
NRE fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxDorob committed Jun 18, 2024
1 parent fe4c47c commit ca098d5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class PawnRenderNodeWorker_Drafted : PawnRenderNodeWorker
public override bool CanDrawNow(PawnRenderNode node, PawnDrawParms parms)
{
var pawn = node.tree.pawn;
return (pawn.Drafted || (pawn.CurJob?.def.alwaysShowWeapon ?? false) || (pawn.mindState.duty?.def.alwaysShowWeapon ?? false)) && base.CanDrawNow(node, parms);
return pawn != null && pawn.Spawned && (pawn.Drafted || (pawn.CurJob?.def.alwaysShowWeapon ?? false) || (pawn.mindState?.duty?.def.alwaysShowWeapon ?? false)) && base.CanDrawNow(node, parms);
}
}
}

0 comments on commit ca098d5

Please sign in to comment.