null ref check in cache clearing

This commit is contained in:
c0ffee 2021-08-29 10:29:41 -07:00
parent dd82340545
commit ed2a6fd7ab
2 changed files with 1 additions and 1 deletions

View file

@ -16,7 +16,7 @@ namespace Rimworld_Animations
{
static bool ClearCache(Pawn pawn)
{
return pawn.IsInvisible() || pawn.TryGetComp<CompBodyAnimator>().isAnimating;
return pawn.IsInvisible() || (pawn.TryGetComp<CompBodyAnimator>() != null && pawn.TryGetComp<CompBodyAnimator>().isAnimating);
}
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)