This project is read-only.


IndexOutOfRangeException on parsing.


Hi. We're using fastJSON in an online game made using Unity. We're seeing quite a lot of IndexOutOfRangeExceptions in our crash reporting, and can't seem to get quite a hang of why it's crashing. We tried logging the string that is being parsed with our crash reports, but that isn't working out quite as well as we expected. Do you have a check for whether a string is valid JSON or not, so we can respond appropriately. We're parsing data from a http response (in a coroutine). I've also attached the stack trace so you can get an idea of what's happening:

Array index is out of range., fastJSON.JsonParser.NextTokenCore () fastJSON.JsonParser.LookAhead () fastJSON.JsonParser.ParseValue () fastJSON.JsonParser.Decode () fastJSON.JSON.Parse (System.String json)

Closed Jul 15, 2016 at 12:37 PM by MGholam


MGholam wrote Apr 3, 2014 at 4:20 PM

Currently there is no "json verification" other than the exceptions you are getting (indicating invalid json), the stack trace is not useful without the actual json you were trying to work with.