Skip to content

Commit 5056363

Browse files
committed
Fix formatting empty root
1 parent fb714ac commit 5056363

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/formatCSS.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ function indentRecursive(node, indent = 0) {
1111

1212
export default function formatNodes(root) {
1313
indentRecursive(root)
14-
root.first.raws.before = ''
14+
if (root.first) {
15+
root.first.raws.before = ''
16+
}
1517
}

0 commit comments

Comments
 (0)