mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Check for null. If a NS_EXTERNALHELPERAPPSERVICE_PROGID was not found,
crash would occur.
This commit is contained in:
parent
ff5f81fb66
commit
17461eaf11
@ -368,11 +368,13 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIChannel * aChannel, nsISupports
|
||||
aChannel->GetURI(getter_AddRefs(uri));
|
||||
nsCOMPtr<nsIStreamListener> contentStreamListener;
|
||||
nsCOMPtr<nsIExternalHelperAppService> helperAppService (do_GetService(NS_EXTERNALHELPERAPPSERVICE_PROGID));
|
||||
rv = helperAppService->DoContent(contentType, uri, m_originalContext, &abortProcess, getter_AddRefs(contentStreamListener));
|
||||
if (NS_SUCCEEDED(rv) && contentStreamListener)
|
||||
return RetargetOutput(aChannel, contentType, contentType, contentStreamListener);
|
||||
else
|
||||
rv = NS_ERROR_FAILURE; // this will cause us to bring up the unknown content handler dialog.
|
||||
if (helperAppService)
|
||||
{
|
||||
rv = helperAppService->DoContent(contentType, uri, m_originalContext, &abortProcess, getter_AddRefs(contentStreamListener));
|
||||
if (NS_SUCCEEDED(rv) && contentStreamListener)
|
||||
return RetargetOutput(aChannel, contentType, contentType, contentStreamListener);
|
||||
}
|
||||
rv = NS_ERROR_FAILURE; // this will cause us to bring up the unknown content handler dialog.
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
|
Loading…
Reference in New Issue
Block a user