mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 10:33:33 +00:00
fix for bug 199910 - should HTTP null-check prompt callbacks?. r-dougt, sr-darin.
This commit is contained in:
parent
11ad7740c2
commit
3eab16a931
@ -753,6 +753,8 @@ nsHttpChannel::GetCallback(const nsIID &aIID, void **aResult)
|
||||
{
|
||||
nsresult rv;
|
||||
NS_ASSERTION(aResult, "Invalid argument in GetCallback!");
|
||||
*aResult = nsnull;
|
||||
NS_ENSURE_TRUE(mCallbacks, NS_ERROR_NOT_INITIALIZED);
|
||||
rv = mCallbacks->GetInterface(aIID, aResult);
|
||||
if (NS_FAILED(rv)) {
|
||||
if (mLoadGroup) {
|
||||
@ -763,6 +765,10 @@ nsHttpChannel::GetCallback(const nsIID &aIID, void **aResult)
|
||||
}
|
||||
}
|
||||
|
||||
// defend against bad nsIInterfaceRequestor implementations.
|
||||
if (NS_SUCCEEDED(rv) && !*aResult)
|
||||
return NS_ERROR_NO_INTERFACE;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -786,11 +792,9 @@ nsHttpChannel::PromptTempRedirect()
|
||||
nsCOMPtr<nsIPrompt> prompt;
|
||||
rv = GetCallback(NS_GET_IID(nsIPrompt), getter_AddRefs(prompt));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (prompt) {
|
||||
prompt->Confirm(nsnull, messageString, &repost);
|
||||
if (!repost)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
prompt->Confirm(nsnull, messageString, &repost);
|
||||
if (!repost)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
Loading…
Reference in New Issue
Block a user