Fixes BuffIcon is NPE (#259)

- [X] Fixes BuffIconTable accessed while null
This commit is contained in:
Kamron Batman 2020-09-19 15:56:22 -07:00 • committed by GitHub
parent e9c1e4cbba
commit fd9ec089f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 19 deletions

View file

@ -131,26 +131,17 @@ namespace Server
public static void AddBuff(Mobile m, BuffInfo b)
{
if (m is PlayerMobile pm)
{
pm.AddBuff(b);
}
(m as PlayerMobile)?.AddBuff(b);
}
public static void RemoveBuff(Mobile m, BuffInfo b)
{
if (m is PlayerMobile pm)
{
pm.RemoveBuff(b);
}
(m as PlayerMobile)?.RemoveBuff(b);
}
public static void RemoveBuff(Mobile m, BuffIcon b)
{
if (m is PlayerMobile pm)
{
pm.RemoveBuff(b);
}
(m as PlayerMobile)?.RemoveBuff(b);
}
}