RimWorld

RimWorld

One bed to sleep with all - Polycule Edition
bug report
Exception in Verse.AI.ThinkNode_PrioritySorter TryIssueJobPackage: System.NullReferenceException: Object reference not set to an instance of an object
[Ref 97863908]
at OneBedToSleepWithAll.Patch.RestUtility__FindBedFor.Postfix (RimWorld.Building_Bed& __result, Verse.Pawn sleeper, Verse.Pawn traveler, System.Boolean checkSocialProperness, System.Boolean ignoreOtherReservations, System.Nullable`1[T] guestStatus) [0x00000] in <f2aae1e2229b4923b08ffd17905639c3>:0
at RimWorld.RestUtility.FindBedFor (Verse.Pawn sleeper, Verse.Pawn traveler, System.Boolean checkSocialProperness, System.Boolean ignoreOtherReservations, System.Nullable`1[T] guestStatus) [0x00538] in <24d25868955f4df08b02c73b55f389fe>:0
- POSTFIX densevoid.hui.personalworkcat: Void OneBedToSleepWithAll.Patch.RestUtility__FindBedFor:Postfix(Building_Bed& __result, Pawn sleeper, Pawn traveler, Boolean checkSocialProperness, Boolean ignoreOtherReservations, Nullable`1 guestStatus)
at RimWorld.RestUtility.FindBedFor (Verse.Pawn p) [0x0000a] in <24d25868955f4df08b02c73b55f389fe>:0
at RimWorld.JobGiver_GetRest.TryGiveJob (Verse.Pawn pawn) [0x0008b] in <24d25868955f4df08b02c73b55f389fe>:0
at Verse.AI.ThinkNode_JobGiver.TryIssueJobPackage (Verse.Pawn pawn, Verse.AI.JobIssueParams jobParams) [0x00000] in <24d25868955f4df08b02c73b55f389fe>:0
at Verse.AI.ThinkNode_PrioritySorter.TryIssueJobPackage (Verse.Pawn pawn, Verse.AI.JobIssueParams jobParams) [0x000f2] in <24d25868955f4df08b02c73b55f389fe>:0
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.AI.ThinkNode_PrioritySorter:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Tagger:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Subtree:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Conditional:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.Pawn_JobTracker:DetermineNextJob (Verse.ThinkTreeDef&,bool)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob ()
Verse.AI.Pawn_JobTracker:EndCurrentJob (Verse.AI.JobCondition,bool,bool)
RimWorld.Pawn_DraftController:set_Drafted (bool)
RimWorld.Pawn_DraftController:<GetGizmos>b__15_1 ()
Verse.Command_Toggle:ProcessInput (UnityEngine.Event)
Verse.GizmoGridDrawer:DrawGizmoGrid (System.Collections.Generic.IEnumerable`1<Verse.Gizmo>,single,Verse.Gizmo&,System.Func`2<Verse.Gizmo, bool>,System.Func`2<Verse.Gizmo, bool>,System.Func`2<Verse.Gizmo, bool>,bool)
Verse.GizmoGridDrawer:DrawGizmoGridFor (System.Collections.Generic.IEnumerable`1<object>,Verse.Gizmo&)
RimWorld.MapGizmoUtility:MapUIOnGUI ()
RimWorld.MapInterface:MapInterfaceOnGUI_BeforeMainTabs ()
RimWorld.UIRoot_Play:UIRootOnGUI ()
Verse.Root:OnGUI ()
< >
Showing 1-9 of 9 comments
Pillar 22 Sep @ 11:54pm 
Exception in Verse.AI.ThinkNode_PrioritySorter TryIssueJobPackage: System.NullReferenceException: Object reference not set to an instance of an object
[Ref 97863908] Duplicate stacktrace, see ref for original
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.AI.ThinkNode_PrioritySorter:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Tagger:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Subtree:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Conditional:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.Pawn_JobTracker:DetermineNextJob (Verse.ThinkTreeDef&,bool)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob ()
Verse.AI.Pawn_JobTracker:EndCurrentJob (Verse.AI.JobCondition,bool,bool)
Verse.AI.Pawn_JobTracker:JobTrackerTickInterval (int)
Verse.Pawn:TickInterval (int)
Verse.Thing:DoTick ()
Verse.TickList:Tick ()
Verse.TickManager:DoSingleTick ()
Verse.TickManager:TickManagerUpdate ()
Verse.Game:UpdatePlay ()
Verse.Root_Play:Update ()
Pillar 22 Sep @ 11:55pm 
It will happen when there is no bed.
Only this mod is enabled.
Looks like the RestUtility__FindBedFor.Postfix just needs a couple of NRE checks.
I changed:
if (__result.Medical) return;
to
if (__result != null && __result.Medical) return;
and
Building_Bed sleeper_bed = sleeper.ownership.OwnedBed;
to
Building_Bed sleeper_bed = sleeper?.ownership?.OwnedBed;
Seems to have fixed that issue.
Smeghead 23 Sep @ 3:36am 
Is this what is causing people and animals without beds/sleeping spotsbeing unable to sleep normally and instead collapse from exhaustion?
That's what I was getting, yeah.
csc001 23 Sep @ 4:25am 
Exception in Verse.AI.ThinkNode_PrioritySorter.TryIssueJobPackage: System.NullReferenceException: Object reference not set to an instance of an object
[Ref 2B972F5A]
at OneBedToSleepWithAll.Patch.RestUtility__FindBedFor.Postfix (RimWorld.Building_Bed& __result, Verse.Pawn sleeper, Verse.Pawn traveler, System.Boolean checkSocialProperness, System.Boolean ignoreOtherReservations, System.Nullable`1[T] guestStatus) [0x00000] in <f2aae1e2229b4923b08ffd17905639c3>:0
at RimWorld.RestUtility.FindBedFor (Verse.Pawn sleeper, Verse.Pawn traveler, System.Boolean checkSocialProperness, System.Boolean ignoreOtherReservations, System.Nullable`1[T] guestStatus) [0x00581] in <24d25868955f4df08b02c73b55f389fe>:0
- PREFIX VREAndroidsMod: Void VREAndroids.RestUtility_FindBedFor_Patch:Prefix(Pawn sleeper, Pawn traveler, List`1& __state)
- PREFIX Altered.Carbon: Void AlteredCarbon.RestUtility_FindBedFor_Patch:Prefix(Pawn sleeper, Pawn traveler)
- POSTFIX VREAndroidsMod: Void VREAndroids.RestUtility_FindBedFor_Patch:Postfix(List`1 __state)
- POSTFIX densevoid.hui.personalworkcat: Void OneBedToSleepWithAll.Patch.RestUtility__FindBedFor:Postfix(Building_Bed& __result, Pawn sleeper, Pawn traveler, Boolean checkSocialProperness, Boolean ignoreOtherReservations, Nullable`1 guestStatus)
- POSTFIX Altered.Carbon: Void AlteredCarbon.RestUtility_FindBedFor_Patch:Postfix()
at RimWorld.RestUtility.FindBedFor (Verse.Pawn p) [0x0000a] in <24d25868955f4df08b02c73b55f389fe>:0
at RimWorld.JobGiver_GetRest.TryGiveJob (Verse.Pawn pawn) [0x000df] in <24d25868955f4df08b02c73b55f389fe>:0
- PREFIX OskarPotocki.VanillaTraitsExpanded: Boolean VanillaTraitsExpanded.TryGiveJob_Patch:Prefix(Pawn pawn)
- POSTFIX AM_Patch: Void AncientMarketAI_Libraray.Patch_Rest:postfix(Pawn pawn, Job& __result)
at Verse.AI.ThinkNode_JobGiver.TryIssueJobPackage (Verse.Pawn pawn, Verse.AI.JobIssueParams jobParams) [0x00000] in <24d25868955f4df08b02c73b55f389fe>:0
at Verse.AI.ThinkNode_PrioritySorter.TryIssueJobPackage (Verse.Pawn pawn, Verse.AI.JobIssueParams jobParams) [0x0012f] in <24d25868955f4df08b02c73b55f389fe>:0
- TRANSPILER net.pardeike.rimworld.lib.harmony: IEnumerable`1 VisualExceptions.ExceptionsAndActivatorHandler:Transpiler(IEnumerable`1 instructions, MethodBase original)


something wrong hope fix
Originally posted by TheMiggiestMig:
Looks like the RestUtility__FindBedFor.Postfix just needs a couple of NRE checks.
I changed:
if (__result.Medical) return;
to
if (__result != null && __result.Medical) return;
and
Building_Bed sleeper_bed = sleeper.ownership.OwnedBed;
to
Building_Bed sleeper_bed = sleeper?.ownership?.OwnedBed;
Seems to have fixed that issue.
Are you sure those are the only changes you made? I did the same and am still getting this error
Originally posted by lI||lIIl|l:
Originally posted by TheMiggiestMig:
Looks like the RestUtility__FindBedFor.Postfix just needs a couple of NRE checks.
I changed:
if (__result.Medical) return;
to
if (__result != null && __result.Medical) return;
and
Building_Bed sleeper_bed = sleeper.ownership.OwnedBed;
to
Building_Bed sleeper_bed = sleeper?.ownership?.OwnedBed;
Seems to have fixed that issue.
Are you sure those are the only changes you made? I did the same and am still getting this error
When you compiled it, did you copy the DLL from the Assemblies folder to 1.6/Assemblies?
Maeyanie  [developer] 23 Sep @ 7:31am 
Should be fixed now. Sorry for the oops, I did completely forget that null is a valid state there.
< >
Showing 1-9 of 9 comments
Per page: 1530 50