add null check so that InventoryDef.Properties no longer causes a NullReferenceException, and returns properties correctly.

This commit is contained in:
Peter Dawe 2023-12-13 14:14:01 -03:30
parent d06054875a
commit 42667f8578

View File

@ -95,7 +95,7 @@ public InventoryRecipe[] GetRecipes()
/// </summary>
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;