From d6205b6157817ccb8497f0396d96d0613d13b036 Mon Sep 17 00:00:00 2001 From: kipp Date: Tue, 30 Jun 1998 20:22:27 +0000 Subject: [PATCH] Avoid crashing when no link handler is involved git-svn-id: svn://10.0.0.236/trunk@4732 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/html/style/src/nsCSSStyleSheet.cpp | 3 ++- mozilla/layout/html/style/src/nsCSSStyleSheet.cpp | 3 ++- mozilla/layout/style/nsCSSStyleSheet.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp index b07e254e8cf..a98d52ff1d4 100644 --- a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp @@ -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); diff --git a/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp b/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp index b07e254e8cf..a98d52ff1d4 100644 --- a/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp +++ b/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp @@ -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); diff --git a/mozilla/layout/style/nsCSSStyleSheet.cpp b/mozilla/layout/style/nsCSSStyleSheet.cpp index b07e254e8cf..a98d52ff1d4 100644 --- a/mozilla/layout/style/nsCSSStyleSheet.cpp +++ b/mozilla/layout/style/nsCSSStyleSheet.cpp @@ -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);