Avoid crashing when no link handler is involved

This commit is contained in:
kipp 1998-06-30 20:22:27 +00:00
parent 90d3d36058
commit 3f7d5435a3
3 changed files with 6 additions and 3 deletions

View File

@ -417,7 +417,8 @@ static PRBool SelectorMatches(nsIPresContext* aPresContext,
// test link state
nsILinkHandler* linkHandler;
if (NS_OK == aPresContext->GetLinkHandler(&linkHandler)) {
if ((NS_OK == aPresContext->GetLinkHandler(&linkHandler)) &&
(nsnull != linkHandler)) {
nsAutoString base, href; // XXX base??
htmlContent->GetAttribute("href", href);

View File

@ -417,7 +417,8 @@ static PRBool SelectorMatches(nsIPresContext* aPresContext,
// test link state
nsILinkHandler* linkHandler;
if (NS_OK == aPresContext->GetLinkHandler(&linkHandler)) {
if ((NS_OK == aPresContext->GetLinkHandler(&linkHandler)) &&
(nsnull != linkHandler)) {
nsAutoString base, href; // XXX base??
htmlContent->GetAttribute("href", href);

View File

@ -417,7 +417,8 @@ static PRBool SelectorMatches(nsIPresContext* aPresContext,
// test link state
nsILinkHandler* linkHandler;
if (NS_OK == aPresContext->GetLinkHandler(&linkHandler)) {
if ((NS_OK == aPresContext->GetLinkHandler(&linkHandler)) &&
(nsnull != linkHandler)) {
nsAutoString base, href; // XXX base??
htmlContent->GetAttribute("href", href);