null ref checks

This commit is contained in:
Platinum 2020-04-22 17:52:59 -07:00
parent 6a1786b03f
commit ca53926996
3 changed files with 8 additions and 5 deletions

View File

@ -1968,24 +1968,27 @@
<li>Anal</li>
<li>Vaginal</li>
</sexTypes>
<actors>
<li>
<!--each type cooresponds to an animation clip in each animationStage-->
<defNames>
<li>Human</li>
</defNames>
<blacklistedRaces>
<li>Human</li>
</blacklistedRaces>
<isFucked>true</isFucked>
<initiator>true</initiator>
</li>
<li>
<defNames>
<li>Human</li>
</defNames>
<isFucking>true</isFucking>
</li>
</actors>
<animationStages>

View File

@ -69,7 +69,7 @@ namespace Rimworld_Animations {
public static bool Prefix_IsSameA(JobDef job, string ___jobDef, ref bool __result) {
if(___jobDef == "Lovin" && rjwLovinDefNames.Contains(job.ToString())) {
if(___jobDef != null && ___jobDef == "Lovin" && job?.defName != null && rjwLovinDefNames.Contains(job?.defName)) {
__result = true;
return false;
}
@ -79,7 +79,7 @@ namespace Rimworld_Animations {
public static bool Prefix_IsSameB(string jobName, string ___jobDef, ref bool __result) {
if (___jobDef == "Lovin" && rjwLovinDefNames.Contains(jobName)) {
if (___jobDef != null && ___jobDef == "Lovin" && jobName != null && rjwLovinDefNames.Contains(jobName)) {
__result = true;
return false;
}