GopherRequest: fixes for null dereference

CID 1249920
This commit is contained in:
Philippe Saint-Pierre 2015-07-03 13:35:08 -04:00
parent be61575ce6
commit e04f294fe8

View File

@ -354,8 +354,10 @@ BGopherRequest::_ProtocolLoop()
_ParseInput(receiveEnd);
else if (fInputBuffer.Size()) {
// send input directly
fListener->DataReceived(this, (const char *)fInputBuffer.Data(),
fPosition, fInputBuffer.Size());
if (fListener != NULL) {
fListener->DataReceived(this, (const char *)fInputBuffer.Data(),
fPosition, fInputBuffer.Size());
}
fPosition += fInputBuffer.Size();
@ -373,7 +375,8 @@ BGopherRequest::_ProtocolLoop()
if (fPosition > 0) {
fResult.SetLength(fPosition);
fListener->DownloadProgress(this, fPosition, fPosition);
if (fListener != NULL)
fListener->DownloadProgress(this, fPosition, fPosition);
}
fSocket->Disconnect();