From eb0d40ea1a70daede17ad9bf021d3161c863e296 Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Thu, 27 Jul 2023 14:44:14 -0700 Subject: [PATCH] Check for null pawn cum when merging cum --- .../HediffComps/HediffComp_Menstruation.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 5242dbb..6cb2c59 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -902,7 +902,7 @@ namespace RJW_Menstruation bool merged = false; if (!cums.NullOrEmpty()) foreach (Cum cum in cums) { - if (cum.pawn.Equals(cummer)) + if (cum.pawn?.Equals(cummer) ?? false) { cum.MergeWithCum(volume, fertility); merged = true; @@ -917,7 +917,7 @@ namespace RJW_Menstruation bool merged = false; if (!cums.NullOrEmpty()) foreach (Cum cum in cums) { - if (cum.pawn.Equals(cummer)) + if (cum.pawn?.Equals(cummer) ?? false) { cum.MergeWithCum(volume, fertility); merged = true; @@ -954,7 +954,7 @@ namespace RJW_Menstruation bool merged = false; if (!cums.NullOrEmpty()) foreach (Cum cum in cums) { - if (cum.notcum && cum.pawn.Equals(cummer) && cum.notcumLabel.Equals(notcumlabel)) + if (cum.notcum && (cum.pawn?.Equals(cummer) ?? false) && cum.notcumLabel.Equals(notcumlabel)) { cum.MergeWithFluid(volume, decayresist, filthdef); merged = true; @@ -969,7 +969,7 @@ namespace RJW_Menstruation bool merged = false; if (!cums.NullOrEmpty()) foreach (Cum cum in cums) { - if (cum.notcum && cum.pawn.Equals(cummer) && cum.notcumLabel.Equals(notcumlabel)) + if (cum.notcum && (cum.pawn?.Equals(cummer) ?? false) && cum.notcumLabel.Equals(notcumlabel)) { cum.MergeWithFluid(volume, decayresist, filthdef); merged = true;