Skip to content

Commit

Permalink
fix: safe checking if params are present for at rule (#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio-Laguna authored and evilebottnawi committed Dec 14, 2018
1 parent 503391f commit a88fed1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/plugins/postcss-icss-parser.js
Expand Up @@ -75,8 +75,12 @@ export default postcss.plugin(

// Replace tokens in at-rules
css.walkAtRules((atrule) => {
// eslint-disable-next-line no-param-reassign
atrule.params = replaceImportsInString(atrule.params.toString());
// Due reusing `ast` from `postcss-loader` some plugins may lack
// `params` property, we need to account for this possibility
if (atrule.params) {
// eslint-disable-next-line no-param-reassign
atrule.params = replaceImportsInString(atrule.params.toString());
}
});

// Replace tokens in export
Expand Down

0 comments on commit a88fed1

Please sign in to comment.