mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 00:46:02 +02:00
* Safety for empty asJSON. Should not happen, but better safe than sorry
git-svn-id: trunk@42784 -
This commit is contained in:
parent
778ae03532
commit
b38596b925
@ -275,7 +275,8 @@ begin
|
|||||||
AResponse.FreeContentStream:=True;
|
AResponse.FreeContentStream:=True;
|
||||||
AResponse.ContentStream:=TMemoryStream.Create;
|
AResponse.ContentStream:=TMemoryStream.Create;
|
||||||
R:=Res.AsJSON;
|
R:=Res.AsJSON;
|
||||||
AResponse.ContentStream.WriteBuffer(R[1],Length(R));
|
if Length(R)>0 then
|
||||||
|
AResponse.ContentStream.WriteBuffer(R[1],Length(R));
|
||||||
AResponse.ContentLength:=AResponse.ContentStream.Size;
|
AResponse.ContentLength:=AResponse.ContentStream.Size;
|
||||||
R:=''; // Free up mem
|
R:=''; // Free up mem
|
||||||
AResponse.ContentType:=GetResponseContentType;
|
AResponse.ContentType:=GetResponseContentType;
|
||||||
|
Loading…
Reference in New Issue
Block a user