diff --git a/Lib/Protocols/IdSSLOpenSSL.pas b/Lib/Protocols/IdSSLOpenSSL.pas index 65ca53817..685e333f5 100644 --- a/Lib/Protocols/IdSSLOpenSSL.pas +++ b/Lib/Protocols/IdSSLOpenSSL.pas @@ -3828,6 +3828,7 @@ function TIdSSLSocket.Recv(var ABuffer: TIdBytes): Integer; ret, err: Integer; begin repeat + if fSSL = nil then Break; ret := SSL_read(fSSL, PByte(ABuffer), Length(ABuffer)); if ret > 0 then begin Result := ret; @@ -3852,6 +3853,7 @@ function TIdSSLSocket.Send(const ABuffer: TIdBytes; AOffset, ALength: Integer): begin Result := 0; repeat + if fSSL = nil then Break; ret := SSL_write(fSSL, @ABuffer[AOffset], ALength); if ret > 0 then begin Inc(Result, ret);