From 42667f8578e378fa6ace3129508a21f3026b2a54 Mon Sep 17 00:00:00 2001 From: Peter Dawe Date: Wed, 13 Dec 2023 14:14:01 -0330 Subject: [PATCH] add null check so that InventoryDef.Properties no longer causes a NullReferenceException, and returns properties correctly. --- Facepunch.Steamworks/Structs/InventoryDef.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/Structs/InventoryDef.cs b/Facepunch.Steamworks/Structs/InventoryDef.cs index 2afb6f7..332e2a4 100644 --- a/Facepunch.Steamworks/Structs/InventoryDef.cs +++ b/Facepunch.Steamworks/Structs/InventoryDef.cs @@ -95,7 +95,7 @@ public InventoryRecipe[] GetRecipes() /// public string GetProperty( string name ) { - if ( _properties!= null && _properties.TryGetValue( name, out string val ) ) + if (name != null && _properties!= null && _properties.TryGetValue( name, out string val ) ) return val; uint _ = (uint)Helpers.MaxStringSize;