From b22ae519550df63ca683bc7e27ff9f4f0be1c382 Mon Sep 17 00:00:00 2001 From: Jennifer Thakar Date: Fri, 15 Feb 2019 21:53:17 +0000 Subject: [PATCH] Fix bug in RecursiveStatementVisitor (#596) The value of an `AtRule` can be null, so it should not be visited in that case. Ran across this issue when I attempted to run the module migrator on a stylesheet containing `@font-face` (which has children, but no value). --- lib/src/visitor/recursive_statement.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/visitor/recursive_statement.dart b/lib/src/visitor/recursive_statement.dart index 183a1b9d..b6fbba8b 100644 --- a/lib/src/visitor/recursive_statement.dart +++ b/lib/src/visitor/recursive_statement.dart @@ -29,7 +29,7 @@ abstract class RecursiveStatementVisitor implements StatementVisitor { T visitAtRule(AtRule node) { visitInterpolation(node.name); - visitInterpolation(node.value); + if (node.value != null) visitInterpolation(node.value); return node.children == null ? null : visitChildren(node); }