don't dereference aContext without checking for null
git-svn-id: svn://10.0.0.236/trunk@30656 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
78baed957e
commit
abe1512581
@ -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