Skip to content

Commit

Permalink
fix: do not crash on errors (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Jul 3, 2020
1 parent 9a16432 commit e854933
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ function loader(content) {

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

callback(new SassError(error));

Expand Down

0 comments on commit e854933

Please sign in to comment.