Added assertion and trivial recovery code to catch the case of a load group

listener factory that reports success, but nevertheless returns a NULL stream
listener.
This commit is contained in:
fur%geocast.com 1999-12-18 14:59:59 +00:00
Родитель d2178447d3
Коммит afa07d4972
1 изменённых файлов: 5 добавлений и 0 удалений

5
netwerk/cache/mgr/nsCacheEntryChannel.cpp поставляемый
Просмотреть файл

@ -169,6 +169,8 @@ nsCacheEntryChannel::AsyncRead(PRUint32 aStartPosition, PRInt32 aReadCount,
{ {
nsresult rv; nsresult rv;
NS_ENSURE_ARG(aListener);
mCacheEntry->NoteAccess(); mCacheEntry->NoteAccess();
nsCOMPtr<nsIStreamListener> headListener; nsCOMPtr<nsIStreamListener> headListener;
@ -183,6 +185,9 @@ nsCacheEntryChannel::AsyncRead(PRUint32 aStartPosition, PRInt32 aReadCount,
getter_AddRefs(headListener)); getter_AddRefs(headListener));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
} }
NS_ASSERTION(headListener, "Load group listener factory did not create listener");
if (!headListener)
headListener = aListener;
} else { } else {
headListener = aListener; headListener = aListener;