Bug 47263 - null check for top crasher (mOutputStream becomes null -- could be going through END_READ state twice).

This commit is contained in:
warren%netscape.com 2000-11-01 00:58:10 +00:00
parent 5d1cbe00c6
commit fe7c6ebabe

View File

@ -62,10 +62,10 @@ nsFileTransport::nsFileTransport()
mCancelStatus(NS_OK),
mMonitor(nsnull),
mStatus(NS_OK),
mLoadAttributes(LOAD_NORMAL),
mOffset(0),
mTotalAmount(-1),
mTransferAmount(-1),
mLoadAttributes(LOAD_NORMAL),
mBuffer(nsnull),
mService(nsnull)
{
@ -513,8 +513,10 @@ nsFileTransport::Process(void)
// of the data in the stream/file.
mStatus = NS_BASE_STREAM_CLOSED;
}
mOutputStream->Flush();
mOutputStream = null_nsCOMPtr();
if (mOutputStream) {
mOutputStream->Flush();
mOutputStream = null_nsCOMPtr();
}
mInputStream = null_nsCOMPtr();
mSource = null_nsCOMPtr();