Null check in the xenotype decider

This commit is contained in:
lutepickle 2022-11-20 12:42:40 -08:00
parent 5a17c0e72f
commit 8d0d980048

View file

@ -634,8 +634,8 @@ namespace RJW_Menstruation
} }
XenotypeDef motherInheritableXenotype = mother?.genes?.Xenotype; XenotypeDef motherInheritableXenotype = mother?.genes?.Xenotype;
XenotypeDef fatherInheritableXenotype = father?.genes?.Xenotype; XenotypeDef fatherInheritableXenotype = father?.genes?.Xenotype;
if (!motherInheritableXenotype.inheritable) motherInheritableXenotype = null; if (!(motherInheritableXenotype?.inheritable ?? false)) motherInheritableXenotype = null;
if (!fatherInheritableXenotype.inheritable) fatherInheritableXenotype = null; if (!(fatherInheritableXenotype?.inheritable ?? false)) fatherInheritableXenotype = null;
// If they're the same (or both null) // If they're the same (or both null)
if (motherInheritableXenotype == fatherInheritableXenotype) if (motherInheritableXenotype == fatherInheritableXenotype)