Fix null reference error

This commit is contained in:
amevarashi 2022-05-03 10:05:47 +05:00
parent 2f186be3e1
commit cce4fd357f
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@ namespace RJWSexperience.Cum.Interactions
var log = LogManager.GetLogger<CumAddictPartKindUsageRule, DebugLogProvider>();
log.Message($"Called for {pawn.NameShortColored}");
if (!(pawn.needs.TryGetNeed(VariousDefOf.Chemical_Cum) is Need_Chemical cumNeed))
if (!(pawn.needs?.TryGetNeed(VariousDefOf.Chemical_Cum) is Need_Chemical cumNeed))
yield break;
log.Message($"{pawn.NameShortColored} is cum addict, current desire level: {cumNeed.CurCategory}");