Skip to content

Commit

Permalink
align to latest csstree changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Jan 29, 2017
1 parent 6638b6e commit 717ba5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/compressor/clean/Atrule.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = function cleanAtrule(node, item, list) {

switch (node.name) {
case 'charset':
if (node.expression.children.isEmpty()) {
if (!node.expression || node.expression.children.isEmpty()) {
list.remove(item);
return;
}
Expand Down
4 changes: 3 additions & 1 deletion lib/compressor/restructure/2-mergeAtrule.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ function processAtrule(node, item, list) {
}

// merge @media with same query
if (node.expression.id === prev.expression.id) {
if (node.expression &&
prev.expression &&
node.expression.id === prev.expression.id) {
prev.block.children.appendList(node.block.children);
prev.loc = {
primary: prev.loc,
Expand Down

0 comments on commit 717ba5b

Please sign in to comment.