Fix error when rule doesn't have a parent

master
Brad Cornes 2021-09-03 13:23:55 +01:00
parent d435db19ed
commit 6812188323
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ export function getRuleContext(state: State, rule: Rule, className: string): str
let context: string[] = [replaceClassName(state, rule.selector, className, '__placeholder__')]
let p: Container = rule
while (p.parent.type !== 'root') {
while (p.parent && p.parent.type !== 'root') {
p = p.parent
if (p.type === 'atrule') {
// @ts-ignore