From 7695174bccafdbfb77d8d9434d641eff020871a2 Mon Sep 17 00:00:00 2001 From: Bohica <53943479+Bohicatv@users.noreply.github.com> Date: Sun, 1 Jun 2025 13:33:09 -0700 Subject: [PATCH] fix: Adds null-conditional checks when stopping timers for TownCrier (#2206) --- Projects/UOContent/Mobiles/Townfolk/TownCrier.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Projects/UOContent/Mobiles/Townfolk/TownCrier.cs b/Projects/UOContent/Mobiles/Townfolk/TownCrier.cs index a2dd13d14..44eadf509 100644 --- a/Projects/UOContent/Mobiles/Townfolk/TownCrier.cs +++ b/Projects/UOContent/Mobiles/Townfolk/TownCrier.cs @@ -118,7 +118,7 @@ public class TownCrierDurationPrompt : Prompt { if (!TimeSpan.TryParse(text, out var ts)) { - from.SendMessage("Value was not properly formatted. Use: "); + from.SendMessage("Value was not properly formatted. Use: "); from.SendGump(new TownCrierGump(from, m_Owner)); return; } @@ -272,7 +272,7 @@ public class TownCrierGump : Gump { if (info.ButtonID == 1) { - m_From.SendMessage("Enter the duration for the new message. Format: "); + m_From.SendMessage("Enter the duration for the new message. Format: "); m_From.Prompt = new TownCrierDurationPrompt(m_Owner); } else if (info.ButtonID > 1) @@ -433,7 +433,7 @@ public partial class TownCrier : Mobile, ITownCrierEntryList if (tce == null) { - _autoShoutTimer.Stop(); + _autoShoutTimer?.Stop(); _autoShoutTimer = null; } else if (_newsTimer == null) @@ -454,7 +454,7 @@ public partial class TownCrier : Mobile, ITownCrierEntryList var index = _newsTimer.Index; if (index >= tce.Lines.Length) { - _newsTimer.Stop(); + _newsTimer?.Stop(); _newsTimer = null; } else