Check for null genes in VEGeneBloodDef

This commit is contained in:
lutepickle 2024-06-23 05:38:49 -07:00
parent d07d08cc34
commit b999c82ebd
2 changed files with 1 additions and 1 deletions

Binary file not shown.

View file

@ -8,7 +8,7 @@ namespace RJW_Menstruation
{
public static ThingDef VEGeneBloodDef(Pawn pawn)
{
if (!ModsConfig.BiotechActive) return null;
if (!ModsConfig.BiotechActive || pawn.genes == null) return null;
foreach(Gene gene in pawn.genes.GenesListForReading.Where(gene => gene.Active))
{
ThingDef bloodDef = gene.def.GetModExtension<GeneExtension>()?.customBloodThingDef;