Skip to content

Commit

Permalink
Fix a crash with nested media rules (#454)
Browse files Browse the repository at this point in the history
Closes #453
  • Loading branch information
nex3 authored Aug 17, 2018
1 parent c5dff3e commit 677d781
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/src/visitor/async_evaluate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/visitor/evaluate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.12.0
version: 1.12.1-dev
description: A Sass implementation in Dart.
author: Dart Team <[email protected]>
homepage: https://github.com/sass/dart-sass
Expand Down

0 comments on commit 677d781

Please sign in to comment.