mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-31 20:30:26 +02:00
* Do not call parsing if JSON is empty (e.g. return 204 with empty body)
This commit is contained in:
parent
e15f731a9b
commit
8d24a28c56
@ -742,6 +742,10 @@ begin
|
|||||||
Addln('begin');
|
Addln('begin');
|
||||||
indent;
|
indent;
|
||||||
Addln('Result := Default(%s);', [aType.PascalName]);
|
Addln('Result := Default(%s);', [aType.PascalName]);
|
||||||
|
Addln('if (aJSON='''') then');
|
||||||
|
indent;
|
||||||
|
Addln('exit;');
|
||||||
|
undent;
|
||||||
if DelphiCode then
|
if DelphiCode then
|
||||||
Addln('lObj := TJSONObject.ParseJSONValue(aJSON,True,True) as TJSONObject;')
|
Addln('lObj := TJSONObject.ParseJSONValue(aJSON,True,True) as TJSONObject;')
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user