Fix for 53399, check for null-pointer to avoid crash, by sean, r=av, a=waterson

This commit is contained in:
av@netscape.com
2000-09-22 06:17:28 +00:00
parent 930d225060
commit 1a32c71e21
2 changed files with 6 additions and 6 deletions

View File

@@ -3284,14 +3284,14 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
nsCOMPtr<nsIDocument> doc;
nsPluginInstancePeerImpl *peer;
rv = aInstance->GetPeer(NS_REINTERPRET_CAST(nsIPluginInstancePeer **, &peer));
if (NS_SUCCEEDED(rv))
if (NS_SUCCEEDED(rv) && peer)
{
nsCOMPtr<nsIPluginInstanceOwner> owner;
rv = peer->GetOwner(*getter_AddRefs(owner));
if (NS_SUCCEEDED(rv))
if (NS_SUCCEEDED(rv) && owner)
{
rv = owner->GetDocument(getter_AddRefs(doc));
if (NS_SUCCEEDED(rv))
if (NS_SUCCEEDED(rv) && doc)
{
nsCOMPtr<nsIURI> docURL( getter_AddRefs(doc->GetDocumentURL()) );