File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -357,12 +357,14 @@ function TRALClientResponse.GetResponseEncText(
357357 vStream : TStream;
358358begin
359359// {$IFDEF FPC}
360- vStream := TRALStringStream.Create(FStream);
361- try
362- Result := StreamToString(vStream);
363- finally
364- FreeAndNil(vStream);
365- end ;
360+ if not Assigned(FStream) then exit;
361+
362+ vStream := TRALStringStream.Create(FStream);
363+ try
364+ Result := StreamToString(vStream);
365+ finally
366+ FreeAndNil(vStream);
367+ end ;
366368// {$ELSE}
367369// vStream := TStringStream.Create(EmptyStr);
368370// FStream.Position := 0;
@@ -380,7 +382,7 @@ procedure TRALClientResponse.SetResponseStream(const AValue: TStream);
380382 if FStream <> nil then
381383 FreeAndNil(FStream);
382384
383- if AValue.size > 0 then
385+ if Assigned( AValue) and (AValue .size > 0 ) then
384386 FStream := Params.DecodeBody(AValue, ContentType, ContentDisposition);
385387end ;
386388
You can’t perform that action at this time.
0 commit comments