* Safety for empty asJSON. Should not happen, but better safe than sorry

git-svn-id: trunk@42784 -
This commit is contained in:
michael 2019-08-24 09:35:47 +00:00
parent 778ae03532
commit b38596b925

View File

@ -275,6 +275,7 @@ begin
AResponse.FreeContentStream:=True;
AResponse.ContentStream:=TMemoryStream.Create;
R:=Res.AsJSON;
if Length(R)>0 then
AResponse.ContentStream.WriteBuffer(R[1],Length(R));
AResponse.ContentLength:=AResponse.ContentStream.Size;
R:=''; // Free up mem