diff --git a/CHANGELOG.md b/CHANGELOG.md index 61ccd5f5..3e5733fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.12.1 + +* Don't crash when a media rule contains another media rule followed by a style + rule. + ## 1.12.0 ### Dart API diff --git a/lib/src/visitor/async_evaluate.dart b/lib/src/visitor/async_evaluate.dart index 42e59677..b77f91f2 100644 --- a/lib/src/visitor/async_evaluate.dart +++ b/lib/src/visitor/async_evaluate.dart @@ -1012,7 +1012,7 @@ class _EvaluateVisitor scopeWhen: node.hasDeclarations); _atRootExcludingStyleRule = oldAtRootExcludingStyleRule; - if (!_inStyleRule) { + if (!_inStyleRule && _parent.children.isNotEmpty) { var lastChild = _parent.children.last; lastChild.isGroupEnd = true; } diff --git a/lib/src/visitor/evaluate.dart b/lib/src/visitor/evaluate.dart index 1701f57b..e29c98a1 100644 --- a/lib/src/visitor/evaluate.dart +++ b/lib/src/visitor/evaluate.dart @@ -5,7 +5,7 @@ // DO NOT EDIT. This file was generated from async_evaluate.dart. // See tool/synchronize.dart for details. // -// Checksum: 79bb19171b8f5f162f86e3892eddae2c2dad5fbb +// Checksum: 2bf89d853d3acfa3d7215dc7a6d43aefe0397519 import 'async_evaluate.dart' show EvaluateResult; export 'async_evaluate.dart' show EvaluateResult; @@ -1005,7 +1005,7 @@ class _EvaluateVisitor scopeWhen: node.hasDeclarations); _atRootExcludingStyleRule = oldAtRootExcludingStyleRule; - if (!_inStyleRule) { + if (!_inStyleRule && _parent.children.isNotEmpty) { var lastChild = _parent.children.last; lastChild.isGroupEnd = true; } diff --git a/pubspec.yaml b/pubspec.yaml index 382fe5f7..92adb98c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: sass -version: 1.12.0 +version: 1.12.1-dev description: A Sass implementation in Dart. author: Dart Team homepage: https://github.com/sass/dart-sass