RimWorld

RimWorld

Long Distance
SineSwiper 29 May, 2021 @ 7:05am
NRE red error on inspection of "Colonist Enroute" message
Every time I try to look at the "Colonist Enroute" message, I'm getting this NRE, which bugs out the UI:

Root level exception in OnGUI(): System.NullReferenceException: Object reference not set to an instance of an object at RimWorld.PawnRelationUtility+<GetRelations>d__0.MoveNext () [0x0004e] in <7927e938de4c4089b4add4215e58d5b1>:0 at RimWorld.PawnRelationUtility.GetMostImportantRelation (Verse.Pawn me, Verse.Pawn other) [0x0002b] in <7927e938de4c4089b4add4215e58d5b1>:0 at LongDistance.Src.Alert_Enroute.GetExplanation () [0x0004a] in <d01ef63522bb48a580cf6b6a48c0f3dd>:0 at RimWorld.Alert.DrawInfoPane () [0x00023] in <7927e938de4c4089b4add4215e58d5b1>:0 at (wrapper dynamic-method) RimWorld.AlertsReadout.RimWorld.AlertsReadout.AlertsReadoutOnGUI_Patch1(RimWorld.AlertsReadout) at (wrapper dynamic-method) RimWorld.UIRoot_Play.RimWorld.UIRoot_Play.UIRootOnGUI_Patch1(RimWorld.UIRoot_Play) at (wrapper dynamic-method) Verse.Root.Verse.Root.OnGUI_Patch1(Verse.Root) Verse.Log:Verse.Log.Error_Patch2(String, Boolean) Verse.Root:Verse.Root.OnGUI_Patch1(Root)

Looks like something from GetExplanation passed a Pawn without any relationship data? GetMostImportantRelation is a pretty small method, so it has to be that for loop here:

foreach (PawnRelationDef relation in me.GetRelations(other))
< >
Showing 1-2 of 2 comments
SineSwiper 29 May, 2021 @ 7:20am 
I bet it's the *.relations hits here in GetRelations:

me.relations.RelatedToAnyoneOrAnyoneRelatedToMe && other.relations.RelatedToAnyoneOrAnyoneRelatedToMe
bdew  [developer] 5 Jul, 2021 @ 1:07am 
That's weird... I can't reproduce that error and looking at the code i don't see why the relations object would be null.

Could be some other mod messing something up i guess?

I'll add a check for that and make it log a warning.
< >
Showing 1-2 of 2 comments
Per page: 1530 50