Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when PlayerNode has an empty array in Weapons #28

Open
n1c opened this issue Aug 11, 2019 · 0 comments
Open

Exception when PlayerNode has an empty array in Weapons #28

n1c opened this issue Aug 11, 2019 · 0 comments

Comments

@n1c
Copy link

n1c commented Aug 11, 2019

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": []
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant