From f7ec0f60a25996886e89d0d5814a35520b49986c Mon Sep 17 00:00:00 2001 From: Spagles <106791090+Spagles@users.noreply.github.com> Date: Wed, 29 Jul 2026 09:02:06 +0000 Subject: [PATCH 1/3] fix(TeachingPatches): enhance null-check for pawn target in WorkGiverTeachUnsetTarget --- Source/Client/Patches/TeachingPatches.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Client/Patches/TeachingPatches.cs b/Source/Client/Patches/TeachingPatches.cs index dd229f8df..6bafa82cc 100644 --- a/Source/Client/Patches/TeachingPatches.cs +++ b/Source/Client/Patches/TeachingPatches.cs @@ -15,7 +15,7 @@ static bool Prefix(Thing t, ref Job __result) if (!Multiplayer.InInterface) return true; // If target is not pawn, no result - if (t is not Pawn pawn) + if (t is not Pawn pawn || pawn.CurJob == null) return false; // Alternative approach would be to store the current target of the lesson taking pawn in the From 6e029fee32e2a9146541dd4d0f0b76283edac6c2 Mon Sep 17 00:00:00 2001 From: Spagles <106791090+Spagles@users.noreply.github.com> Date: Wed, 29 Jul 2026 09:04:26 +0000 Subject: [PATCH 2/3] fix(AsyncWorldTimeComp): add null check for async time maps in DesiredTimeSpeed property --- Source/Client/AsyncTime/AsyncWorldTimeComp.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Client/AsyncTime/AsyncWorldTimeComp.cs b/Source/Client/AsyncTime/AsyncWorldTimeComp.cs index 7db59bb68..1855aa5a8 100644 --- a/Source/Client/AsyncTime/AsyncWorldTimeComp.cs +++ b/Source/Client/AsyncTime/AsyncWorldTimeComp.cs @@ -50,7 +50,7 @@ public TimeSpeed DesiredTimeSpeed get => !Find.Maps.Any() ? timeSpeedInt : Find.Maps.Select(m => m.AsyncTime()) - .Where(a => a.ActualRateMultiplier(a.DesiredTimeSpeed) != 0f) + .Where(a => a != null && a.ActualRateMultiplier(a.DesiredTimeSpeed) != 0f) .Max(a => a?.DesiredTimeSpeed) ?? TimeSpeed.Paused; set => timeSpeedInt = value; } From 50195c1c7e342224c388de096437a4664108a8e9 Mon Sep 17 00:00:00 2001 From: Spagles <106791090+Spagles@users.noreply.github.com> Date: Wed, 29 Jul 2026 09:05:29 +0000 Subject: [PATCH 3/3] fix(ThingDespawnUnsetForbidden): add null check for Map in Notify_ThingDespawned call --- Source/Client/Factions/Forbiddables.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Client/Factions/Forbiddables.cs b/Source/Client/Factions/Forbiddables.cs index 590e9d58e..8a700ec91 100644 --- a/Source/Client/Factions/Forbiddables.cs +++ b/Source/Client/Factions/Forbiddables.cs @@ -116,7 +116,7 @@ static class ThingDespawnUnsetForbidden static void Prefix(Thing __instance) { if (Multiplayer.Client == null) return; - __instance.Map.MpComp().Notify_ThingDespawned(__instance); + __instance.Map?.MpComp()?.Notify_ThingDespawned(__instance); } } }