From 7f686a6ae58e2fc73d9f6649527259d6fee7f2cd Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Sat, 8 Jun 2024 14:50:20 -0400 Subject: [PATCH] Fix null ref exception in PrayerSystem (#28712) * Fix null ref exception in PrayerSystem * Also check that prayable ent/comp still exist --- Content.Server/Prayer/PrayerSystem.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Content.Server/Prayer/PrayerSystem.cs b/Content.Server/Prayer/PrayerSystem.cs index 3b1ec3fa08..59fd9a5d69 100644 --- a/Content.Server/Prayer/PrayerSystem.cs +++ b/Content.Server/Prayer/PrayerSystem.cs @@ -56,7 +56,9 @@ public sealed class PrayerSystem : EntitySystem _quickDialog.OpenDialog(actor.PlayerSession, Loc.GetString(comp.Verb), Loc.GetString("prayer-popup-notify-pray-ui-message"), (string message) => { - Pray(actor.PlayerSession, comp, message); + // Make sure the player's entity and the Prayable entity+component still exist + if (actor?.PlayerSession != null && HasComp(uid)) + Pray(actor.PlayerSession, comp, message); }); }, Impact = LogImpact.Low, -- 2.51.2