Fix crash if the channel gets canceled too early. Bug 390938, r+sr=biesi

This commit is contained in:
bzbarsky@mit.edu 2007-08-06 18:59:10 -07:00
Родитель 679c0f8726
Коммит 6e5bc45402
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -156,6 +156,14 @@ nsGopherContentStream::OnInputStreamReady(nsIAsyncInputStream *stream)
NS_IMETHODIMP NS_IMETHODIMP
nsGopherContentStream::OnOutputStreamReady(nsIAsyncOutputStream *stream) nsGopherContentStream::OnOutputStreamReady(nsIAsyncOutputStream *stream)
{ {
// If we're already closed, mSocketOutput is going to be null and we'll
// just be getting notified that it got closed (by outselves). In that
// case, nothing to do here.
if (!mSocketOutput) {
NS_ASSERTION(NS_FAILED(Status()), "How did that happen?");
return NS_OK;
}
// We have to close ourselves if we hit an error here in order to propagate // We have to close ourselves if we hit an error here in order to propagate
// the error to our consumer. Otherwise, just forward the notification so // the error to our consumer. Otherwise, just forward the notification so
// that the consumer will know to start reading. // that the consumer will know to start reading.