From 76035f6bd1e11794ed9e343c080df286b5af2bb4 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Sat, 6 Feb 2021 21:07:59 -0800 Subject: [PATCH] fix(recipes): Fixes NPE with recipes on PlayerMobile (#476) --- Projects/UOContent/Mobiles/PlayerMobile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projects/UOContent/Mobiles/PlayerMobile.cs b/Projects/UOContent/Mobiles/PlayerMobile.cs index cc66f4fe9..8050f3dab 100644 --- a/Projects/UOContent/Mobiles/PlayerMobile.cs +++ b/Projects/UOContent/Mobiles/PlayerMobile.cs @@ -4561,7 +4561,8 @@ namespace Server.Mobiles public virtual bool HasRecipe(Recipe r) => r != null && HasRecipe(r.ID); - public virtual bool HasRecipe(int recipeID) => m_AcquiredRecipes.TryGetValue(recipeID, out var value) && value; + public virtual bool HasRecipe(int recipeID) => + m_AcquiredRecipes != null && m_AcquiredRecipes.TryGetValue(recipeID, out var value) && value; public virtual void AcquireRecipe(Recipe r) { @@ -4574,7 +4575,6 @@ namespace Server.Mobiles public virtual void AcquireRecipe(int recipeID) { m_AcquiredRecipes ??= new Dictionary(); - m_AcquiredRecipes[recipeID] = true; }