Skip to content

Exception when PlayerNode has an empty array in Weapons #28

@n1c

Description

@n1c

Hey!

I've been experimenting with a little project and noticed when testing that the library seems to exception out when a player has an empty list of weapons.

Newtonsoft.Json.Linq.JObject.Load (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Linq.JsonLoadSettings settings) (at <bf474636719e4bcd9f70a47a268cfe27>:0)
Newtonsoft.Json.Linq.JObject.Parse (System.String json, Newtonsoft.Json.Linq.JsonLoadSettings settings) (at <bf474636719e4bcd9f70a47a268cfe27>:0)
Newtonsoft.Json.Linq.JObject.Parse (System.String json) (at <bf474636719e4bcd9f70a47a268cfe27>:0)
CSGSI.Nodes.NodeBase..ctor (System.String json) (at <b9cb9d037ba0446fb63dc61a7bd60f24>:0)
CSGSI.Nodes.WeaponsNode..ctor (System.String json) (at <b9cb9d037ba0446fb63dc61a7bd60f24>:0)
CSGSI.Nodes.PlayerNode..ctor (System.String json) (at <b9cb9d037ba0446fb63dc61a7bd60f24>:0)
CSGSI.Nodes.AllPlayersNode..ctor (System.String json) (at <b9cb9d037ba0446fb63dc61a7bd60f24>:0)
CSGSI.GameState.get_AllPlayers () (at <b9cb9d037ba0446fb63dc61a7bd60f24>:0)
Listener.Update () (at Assets/Scripts/Listener.cs:48)

Here's a really stripped down payload with the offending empty list:

{
  "allplayers": {
    "76561191119937323": {
      "weapons": []
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions