mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 09:19:28 +00:00
don't dereference aContext without checking for null
This commit is contained in:
parent
faa282cbe5
commit
b8c3aa89b4
@ -534,7 +534,9 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
|
||||
// XXX Stop-gap fix to prevent ua.css rules from being applied
|
||||
// to XML elements
|
||||
nsIHTMLContent *htmlContent;
|
||||
nsresult rv = aContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
if (aContent)
|
||||
rv = aContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
PRInt32 ruleCount = 0;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
ruleCount += RulesMatching(mBackstopSheets, aPresContext, medium, aContent, aParentContext, rules);
|
||||
|
@ -534,7 +534,9 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
|
||||
// XXX Stop-gap fix to prevent ua.css rules from being applied
|
||||
// to XML elements
|
||||
nsIHTMLContent *htmlContent;
|
||||
nsresult rv = aContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
if (aContent)
|
||||
rv = aContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
PRInt32 ruleCount = 0;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
ruleCount += RulesMatching(mBackstopSheets, aPresContext, medium, aContent, aParentContext, rules);
|
||||
|
@ -534,7 +534,9 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
|
||||
// XXX Stop-gap fix to prevent ua.css rules from being applied
|
||||
// to XML elements
|
||||
nsIHTMLContent *htmlContent;
|
||||
nsresult rv = aContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
if (aContent)
|
||||
rv = aContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
PRInt32 ruleCount = 0;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
ruleCount += RulesMatching(mBackstopSheets, aPresContext, medium, aContent, aParentContext, rules);
|
||||
|
Loading…
x
Reference in New Issue
Block a user