erdelf / AlienRaces

Rimworld mod alien race framework
MIT License
103 stars 69 forks source link

Update HarmonyPatches.cs #78

Closed weisspure closed 1 year ago

weisspure commented 2 years ago

I'm new to contributing to others' githubs so apologies if Imake a faux pas. If I do please let me know!

If ingester doesn't have traits (i.e. is an animal) then probably best not to postfix vanilla thoughts.

Should fix following exception:

AlienRace encountered an error processing food Pawn: mare 6 | Horse Food: MealSurvivalPack | MealSurvivalPack | Core System.NullReferenceException: Object reference not set to an instance of an object at (wrapper dynamic-method) AlienRace.HarmonyPatches.AlienRace.HarmonyPatches.ThoughtsFromIngestingPostfix_Patch0(Verse.Pawn,Verse.Thing,Verse.ThingDef,System.Collections.Generic.List`1<RimWorld.FoodUtility/ThoughtFromIngesting>&) (Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

weisspure commented 2 years ago

Tested via local mod. Errors no longer occur.