From 505636309037a5c5aa9a2be21ccaeba2bd529e31 Mon Sep 17 00:00:00 2001 From: Kyle Coburn Date: Fri, 19 Apr 2019 20:32:54 -0700 Subject: [PATCH] Fix formatting empty root --- src/lib/formatCSS.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/formatCSS.js b/src/lib/formatCSS.js index 6ff7fc40ba10..75adde499427 100644 --- a/src/lib/formatCSS.js +++ b/src/lib/formatCSS.js @@ -11,5 +11,7 @@ function indentRecursive(node, indent = 0) { export default function formatNodes(root) { indentRecursive(root) - root.first.raws.before = '' + if (root.first) { + root.first.raws.before = '' + } }