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

nullpointer when parsing JSON that starts with Array #130

Open
laundmo opened this issue Jul 10, 2018 · 1 comment
Open

nullpointer when parsing JSON that starts with Array #130

laundmo opened this issue Jul 10, 2018 · 1 comment

Comments

@laundmo
Copy link

laundmo commented Jul 10, 2018

i'm trying to parse a JSON that starts with a array. [ {...}, {...} ]

although when i try to cast that to a JSONObject i get a nullPointer later on when trying to .get(key) anything

but casting to JSONArray the size of the array is 0 and i get a nullPointer when trying to use .get(0)

my goal is to get the second object.

@laundmo laundmo changed the title parser.parse(in); needs to be cast to json object even if json starts with array. parser.parse(in); when the JSON starts with Array Jul 10, 2018
@laundmo laundmo changed the title parser.parse(in); when the JSON starts with Array nullpointer when parsing JSON that starts with Array Jul 10, 2018
@jredfox
Copy link

jredfox commented Mar 3, 2019

this issue is invalid as JSONObject isn't a JSONArray and the parser first returns the JSONArray object not a JSONObject

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

2 participants