diff --git a/RJWSexperience/RJWSexperience/Patches/GetGizmos.cs b/RJWSexperience/RJWSexperience/Patches/GetGizmos.cs index 6c975ac..5cdf052 100644 --- a/RJWSexperience/RJWSexperience/Patches/GetGizmos.cs +++ b/RJWSexperience/RJWSexperience/Patches/GetGizmos.cs @@ -12,17 +12,19 @@ namespace RJWSexperience if (Find.Selector.NumSelected > 1) return; - __result = AddHistoryGizmo(__instance, __result); + SexHistoryComp history = __instance.TryGetComp(); + if (history == null) + return; + + __result = AddHistoryGizmo(history, __result); } - private static IEnumerable AddHistoryGizmo(Pawn pawn, IEnumerable gizmos) + private static IEnumerable AddHistoryGizmo(SexHistoryComp history, IEnumerable gizmos) { foreach (Gizmo gizmo in gizmos) yield return gizmo; - SexHistoryComp history = pawn.TryGetComp(); - if (history != null) - yield return history.Gizmo; + yield return history.Gizmo; } } }