mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 20:49:27 +00:00
Avoid crashing when no link handler is involved
This commit is contained in:
parent
90d3d36058
commit
3f7d5435a3
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user