Have GetMenstruationComp(pregnancy) null test

This commit is contained in:
lutepickle 2022-07-11 19:05:21 -07:00
parent 70346a0901
commit 931b974bf9
1 changed files with 2 additions and 1 deletions

View File

@ -57,7 +57,8 @@ namespace RJW_Menstruation
public static HediffComp_Menstruation GetMenstruationComp(this Hediff_BasePregnancy pregnancy)
{
return pregnancy.pawn.GetMenstruationComps().FirstOrDefault(comp => comp.Pregnancy == pregnancy);
if (pregnancy == null) return null;
else return pregnancy.pawn.GetMenstruationComps().FirstOrDefault(comp => comp.Pregnancy == pregnancy);
}
public static HediffComp_Anus GetAnusComp(this Pawn pawn)