| Index: Source/core/css/RuleSet.cpp
|
| diff --git a/Source/core/css/RuleSet.cpp b/Source/core/css/RuleSet.cpp
|
| index fefc1e4310b1aa9006b8ffcfa65737dd361a0a0b..a745456129f99c6f77be7d50a853fdfa68f7c5b4 100644
|
| --- a/Source/core/css/RuleSet.cpp
|
| +++ b/Source/core/css/RuleSet.cpp
|
| @@ -177,10 +177,12 @@ bool RuleSet::findBestRuleSetAndAdd(const CSSSelector& component, RuleData& rule
|
| #endif
|
|
|
| const CSSSelector* it = &component;
|
| - for (; it->relation() == CSSSelector::SubSelector; it = it->tagHistory()) {
|
| + for (; it && it->relation() == CSSSelector::SubSelector; it = it->tagHistory()) {
|
| extractValuesforSelector(it, id, className, customPseudoElementName, tagName);
|
| }
|
| - extractValuesforSelector(it, id, className, customPseudoElementName, tagName);
|
| + // FIXME: this null check should not be necessary. See crbug.com/358475
|
| + if (it)
|
| + extractValuesforSelector(it, id, className, customPseudoElementName, tagName);
|
|
|
| // Prefer rule sets in order of most likely to apply infrequently.
|
| if (!id.isEmpty()) {
|
|
|