From 27c76f8f470d0db9bec873f1038c1a529df19e02 Mon Sep 17 00:00:00 2001 From: "pnunn%netscape.com" Date: Mon, 22 May 2000 23:01:26 +0000 Subject: [PATCH] bug#36242: add test in il_PermitLoad(). pnunn, rev:morse. --- modules/libimg/src/if.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/libimg/src/if.cpp b/modules/libimg/src/if.cpp index ff6d58485b02..a517c403d31f 100644 --- a/modules/libimg/src/if.cpp +++ b/modules/libimg/src/if.cpp @@ -1918,17 +1918,20 @@ PRBool il_PermitLoad(const char * image_url, nsIImageRequestObserver * aObserver rv = frameImageLoader->GetPresContext(getter_AddRefs(presContext)); if (presContext) { nsCOMPtr firstURI; + presContext->GetBaseURL(getter_AddRefs(firstURI)); /* Check to see if the image is the whole page, in which case accept it */ PRBool eq; - firstURI->Equals(uri, &eq); - if (eq) { - Recycle(host); - return PR_TRUE; + + if(firstURI){ + firstURI->Equals(uri, &eq); + if (eq) { + Recycle(host); + return PR_TRUE; + } + rv = firstURI->GetHost(&firstHost); } - - rv = firstURI->GetHost(&firstHost); } } if (!firstHost) {