RimWorld

RimWorld

RimTalk
NullReferenceException after latest update (FloatMenuMakerMap.GetOptions conflict)
Hi,
After the latest update, I started getting this error when right-clicking on the map:

Exception in RimWorld.Selector.HandleMapClicks: System.NullReferenceException: Object reference not set to an instance of an object
[Ref AF6CA0]
at RimWorld.FloatMenuMakerMap.GetProviderOptions (RimWorld.FloatMenuContext context, System.Collections.Generic.List`1[T] options) [0x00000] in <24d25868955f4df08b02c73b55f389fe>:0
- TRANSPILER net.pardeike.rimworld.lib.harmony: IEnumerable`1 VisualExceptions.ExceptionsAndActivatorHandler:Transpiler(IEnumerable`1 instructions, MethodBase original)
at RimWorld.FloatMenuMakerMap.GetOptions (System.Collections.Generic.List`1[T] selectedPawns, UnityEngine.Vector3 clickPos, RimWorld.FloatMenuContext& context) [0x0012e] in <24d25868955f4df08b02c73b55f389fe>:0
- POSTFIX co.uk.epicguru.meleeanimation: Void AM.Patches.Patch_FloatMenuMakerMap_GetOptions:Postfix(Vector3 clickPos, List`1 selectedPawns, List`1 __result)
- POSTFIX cj.rimtalk: Void RimTalk.Patch.FloatMenuPatch:Postfix(List`1 selectedPawns, Vector3 clickPos, FloatMenuContext context, List`1& __result)
at RimWorld.Selector.HandleMapClicks () [0x000b8] in <24d25868955f4df08b02c73b55f389fe>:0
- TRANSPILER net.pardeike.rimworld.lib.harmony: IEnumerable`1 VisualExceptions.ExceptionsAndActivatorHandler:Transpiler(IEnumerable`1 instructions, MethodBase original)
- PREFIX SmashPhil.VehicleFramework: Boolean Vehicles.Patch_Misc:MultiSelectFloatMenu(List`1 ___selected)

I already tested with a new save, and the issue still happens.
It seems to appear right after the latest mod update.
From the stack trace, it might be related to a missing null check for FloatMenuContext or selectedPawns inside the Postfix patch.

Could you please check if something changed in the FloatMenu handling recently?

Thanks!
< >
Showing 1-4 of 4 comments
Juicy  [developer] Oct 26 @ 2:31pm 
Thanks for the report.

From the stack trace, it doesn’t look like the error is caused by RimTalk. The exception happens before RimTalk’s postfix runs. Could you try removing RimTalk and see if the issue still occurs?
Mr.Jiang Oct 27 @ 7:05am 
Originally posted by Juicy:
Thanks for the report.

From the stack trace, it doesn’t look like the error is caused by RimTalk. The exception happens before RimTalk’s postfix runs. Could you try removing RimTalk and see if the issue still occurs?
I tested it again after disabling RimTalk, and the error still occurs when right-clicking on the map.
So it seems you’re right — the issue isn’t caused by RimTalk.
I’ll report it to the Melee Animation author since that mod also patches FloatMenuMakerMap.GetOptions.

Thanks again for checking and replying so quickly!
Mr.Jiang Oct 31 @ 11:23pm 
Originally posted by Juicy:
Thanks for the report.

From the stack trace, it doesn’t look like the error is caused by RimTalk. The exception happens before RimTalk’s postfix runs. Could you try removing RimTalk and see if the issue still occurs?
Hey, found a possible bug with RimTalk.
I keep getting this error spam in the log:

Exception in Verse.Root.OnGUI: System.InvalidOperationException: Collection was modified; enumeration operation may not execute. [Ref 374B4B41] [0x00000] in <51fded79cd284d4d911c5949aff4cb21>:0 at System.Collections.Generic.List1+Enumerator[T].MoveNextRare () [0x00013] in <51fded79cd284d4d911c5949aff4cb21>:0 at System.Collections.Generic.List1+Enumerator[T].MoveNext () [0x0004a] in <51fded79cd284d4d911c5949aff4cb21>:0 at RimWorld.SituationalThoughtHandler.AppendMoodThoughts (RimWorld.ThoughtDef def, System.Collections.Generic.List1[T] thoughts) [0x00040] in <f7a9e19fc1544299a67a6692e164bd0c>:0 at RimWorld.ThoughtHandler.GetMoodThoughtsFor (RimWorld.ThoughtDef def, System.Collections.Generic.List1[T] thoughts) [0x00050] in <f7a9e19fc1544299a67a6692e164bd0c>:0 at RimWorld.Alert_Thought.get_AffectedPawns () [0x0006c] in <f7a9e19fc1544299a67a6692e164bd0c>:0 at RimWorld.Alert_Thought.GetReport () [0x00000] in <f7a9e19fc1544299a67a6692e164bd0c>:0 at RimWorld.Alert.Recalculate () [0x00000] in <f7a9e19fc1544299a67a6692e164bd0c>:0 at RimWorld.Alert.DrawInfoPane () [0x00014] in <f7a9e19fc1544299a67a6692e164bd0c>:0 at RimWorld.AlertsReadout.AlertsReadoutOnGUI () [0x0016c] in <f7a9e19fc1544299a67a6692e164bd0c>:0 at RimWorld.UIRoot_Play.UIRootOnGUI () [0x0005a] in <f7a9e19fc1544299a67a6692e164bd0c>:0 - PREFIX fxz.rigormortis: Boolean RigorMortis.UIDisplay_Patch:Prefix() - POSTFIX cj.rimtalk: Void RimTalk.UI.OverlayPatch:Postfix() at Verse.Root.OnGUI () [0x00046] in <f7a9e19fc1544299a67a6692e164bd0c>:0 - TRANSPILER net.pardeike.rimworld.lib.harmony: IEnumerable1 VisualExceptions.ExceptionsAndActivatorHandler:Transpiler(IEnumerable1 instructions, MethodBase original) - POSTFIX UnlimitedHugs.HugsLib: Void HugsLib.Patches.Root_OnGUI_Patch:OnGUIHookUnfiltered()


Looks like RimTalk’s UI overlay modifies pawn thoughts or mood data while RimWorld is iterating over them (during OnGUI).
It usually happens when mood/thought alerts are being drawn.
If I disable RimTalk, the error disappears.
I’m also running RigorMortis and HugsLib, so it might be a small conflict between them.

Not a crash, but it keeps spamming the console every few seconds.
Maybe the overlay could skip editing data during OnGUI or work on a copy of the list.
Thanks for the awesome mod anyway 💬

Log here: https://gist.github.com/HugsLibRecordKeeper/ee271bca3675976c8e40b1208314f854
< >
Showing 1-4 of 4 comments
Per page: 1530 50