Facepunch/Facepunch.Steamworks

Accessing InventoryDef.Properties throws a Null Reference Exception

peterdwdawe opened this issue · 1 comments

Describe the bug
As in title, attempting to access or iterate InventoryDef.Properties throws a NullReferenceException

To Reproduce
Steps to reproduce the behavior:

  1. Get an InventoryDef in any way
    e.g. SteamInventory.LoadItemDefinitions() followed by accessing SteamInventory.Definitions

  2. try to access Properties,
    e.g. foreach (var prop in def.Properties)

  3. See error

Calling Code
See above

Expected behavior
No error, return properties as an IEnumerable<KeyValuePair<string,string>>

Desktop (please complete the following information):

  • OS: Windows 10 64 bit
  • Unity: Unity 2019.4

Additional context
Must be tested outside the spacewar AppID, since no InventoryItems can be retrieved on 480.
Caused by a call inside Properties to GetProperty(null), where the dictionary will complain about being given a null key. I will be submitting a pull request that fixes this issue.

ping!
I really need this for my game