[fpc-pascal] TJSONParser crash

Hairy Pixels genericptr at gmail.com
Wed Sep 28 16:16:46 CEST 2022


Ok I narrowed down this bug I get with 3.2.2 to TJSONParser. 

I’m so confused as to what changed.  FormatJSON prints the JSON as expected but AsString crashes and gives the error I was seeing from the RPC which it trapped as an exception. When it’s send across the RPC layer it must call AsString and then blow up thus giving me this error.

The JSON in question printed from FormatJSON is valid and can be opened in a JSON editor even so I know it’s ok.

===========================

Request := TJSONParser.Create(Content, DefaultOptions).Parse;

writeln(Request.FormatJSON);  // this prints the JSON correctly (Request ClassName is TJSONObject)

writeln(Request.AsString); 

gives this error:

An unhandled exception occurred at $00000001050261A7:
EJSON: Cannot convert data from object value
  $00000001050261A7

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list