RimWorld

RimWorld

[SYR] Scar Removal Plus
AngleWyrm 18 Jan, 2021 @ 6:08pm
Bug Reports
Error in static constructor of SyrScarRemoval.ScarRemoval_Constructor: System.TypeInitializationException: The type initializer for 'SyrScarRemoval.ScarRemoval_Constructor' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object
at SyrScarRemoval.ScarRemoval_Constructor.ApplySettings () [0x003e5] in <ce69d8dfdb6c4b129be7d457bbd16e1d>:0
at SyrScarRemoval.ScarRemoval_Constructor..cctor () [0x0000a] in <ce69d8dfdb6c4b129be7d457bbd16e1d>:0
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(intptr)
at System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (System.RuntimeTypeHandle type) [0x0002a] in <567df3e0919241ba98db88bec4c6696f>:0
at Verse.StaticConstructorOnStartupUtility.CallAll () [0x0001a] in <d72310b4d8f64d25aee502792b58549f>:0
Verse.Log:Verse.Log.Error_Patch2(String, Boolean)
Verse.StaticConstructorOnStartupUtility:CallAll()
Verse.<>c:<DoPlayLoad>b__4_2()
Verse.LongEventHandler:ExecuteToExecuteWhenFinished()
Verse.LongEventHandler:UpdateCurrentAsynchronousEvent()
Verse.LongEventHandler:LongEventsUpdate(Boolean&)
Verse.Root:Verse.Root.Update_Patch1(Root)
Verse.Root_Entry:Update()

Full error log[gist.github.com]
< >
Showing 1-3 of 3 comments
About NRE in ScarRemoval_Constructor.ApplySettings() and an error in the mod settings window.

The problem is with some modded animals like in Rimworld of Magic "TM_DemonR" and maybe others.
For those animals ThingDef.recipes == null as the recipe list List<RecipeDef> is not initialized for them for some reason (i didn't dig, maybe a harmony patch in that mod).

To fix: you need to add null check for ThingDef.recipes, preferably when filling `allAnimals`
ExcessBlam 16 Oct, 2022 @ 12:02am 
I also have this error, and use several modded animals, though not Rimworld of Magic in my current list.
Lanthrudar 5 Nov, 2022 @ 9:07am 
Could not resolve cross-reference to Verse.ResearchProjectDef named RegenerativeMedicine (wanter=prerequisites)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.DirectXmlCrossRefLoader:TryResolveDef<Verse.ResearchProjectDef> (string,Verse.FailMode,object)
Verse.DirectXmlCrossRefLoader/WantedRefForList`1<Verse.ResearchProjectDef>:TryResolve (Verse.FailMode)
Verse.DirectXmlCrossRefLoader/<>c__DisplayClass16_1:<ResolveAllWantedCrossReferences>b__0 (Verse.DirectXmlCrossRefLoader/WantedRef)
Verse.GenThreading/<>c__DisplayClass7_1`1<Verse.DirectXmlCrossRefLoader/WantedRef>:<ParallelForEach>b__0 (object)
System.Threading.QueueUserWorkItemCallback:WaitCallback_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.QueueUserWorkItemCallback:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem ()
System.Threading.ThreadPoolWorkQueue:Dispatch ()
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()
< >
Showing 1-3 of 3 comments
Per page: 1530 50