Skip to content

Commit e854933

Browse files
fix: do not crash on errors (#860)
1 parent 9a16432 commit e854933

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ function loader(content) {
4545

4646
render(sassOptions, (error, result) => {
4747
if (error) {
48-
// `node-sass` returns POSIX paths
49-
this.addDependency(path.normalize(error.file));
48+
// There are situations when the `file` property do not exist
49+
if (error.file) {
50+
// `node-sass` returns POSIX paths
51+
this.addDependency(path.normalize(error.file));
52+
}
5053

5154
callback(new SassError(error));
5255

0 commit comments

Comments
 (0)