Skip to content

Commit a88fed1

Browse files
Antonio-Lagunaevilebottnawi
authored andcommitted
fix: safe checking if params are present for at rule (#871)
1 parent 503391f commit a88fed1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/plugins/postcss-icss-parser.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,12 @@ export default postcss.plugin(
7575

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

8286
// Replace tokens in export

0 commit comments

Comments
 (0)