Issue #2835 - Follow-up: Guard against import rules with no attached style sheet

This commit is contained in:
Francis Dominic Fajardo 2025-08-04 00:02:36 +08:00 committed by roytam1
commit 2026586ce1

View file

@ -653,9 +653,10 @@ CascadeRuleEnumFunc(css::Rule* aRule, void* aData)
} else if (css::Rule::IMPORT_RULE == type &&
nsCSSRuleUtils::LoadImportedSheetsInOrderEnabled()) {
css::ImportRule* importRule = static_cast<css::ImportRule*>(aRule);
nsCSSRuleProcessor::CascadeSheet(
importRule->GetStyleSheet()->AsConcrete(),
layer);
StyleSheet* sheet = importRule->GetStyleSheet();
if (sheet) {
nsCSSRuleProcessor::CascadeSheet(sheet->AsConcrete(), layer);
}
}
return true;
}