From fea7aef95f65a64e34c3068a544b4f7079f7dda0 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Thu, 13 Apr 2023 23:43:09 -0700 Subject: [PATCH] fix: Fixes NPE with setting stats in-game (#1390) --- Projects/Server/Mobiles/Mobile.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Projects/Server/Mobiles/Mobile.cs b/Projects/Server/Mobiles/Mobile.cs index 98c325e72..754f6540c 100644 --- a/Projects/Server/Mobiles/Mobile.cs +++ b/Projects/Server/Mobiles/Mobile.cs @@ -1847,7 +1847,7 @@ public class Mobile : IHued, IComparable, ISpawnable, IObjectPropertyLis get => Math.Clamp(m_Str + GetStatOffset(StatType.Str), 1, 65000); set { - if (_statMods.Count == 0) + if (_statMods == null || _statMods.Count == 0) { RawStr = value; } @@ -1905,7 +1905,7 @@ public class Mobile : IHued, IComparable, ISpawnable, IObjectPropertyLis get => Math.Clamp(m_Dex + GetStatOffset(StatType.Dex), 0, 65000); set { - if (_statMods.Count == 0) + if (_statMods == null || _statMods.Count == 0) { RawDex = value; } @@ -1963,7 +1963,7 @@ public class Mobile : IHued, IComparable, ISpawnable, IObjectPropertyLis get => Math.Clamp(m_Int + GetStatOffset(StatType.Int), 0, 65000); set { - if (_statMods.Count == 0) + if (_statMods == null || _statMods.Count == 0) { RawInt = value; }