Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Less error not handled properly #10

Open
d9su opened this issue Apr 4, 2017 · 0 comments
Open

Less error not handled properly #10

d9su opened this issue Apr 4, 2017 · 0 comments

Comments

@d9su
Copy link

d9su commented Apr 4, 2017

In the render method:

    less.render(input, lessOpts, function(err, output) {
      if (err) {
        self.emit('error', new Error(err.message + ': ' + err.filename + '(' + err.line + ')'));
      } else {
        self.queue(jsToLoad(output.css));
      }
      output.imports.forEach(function(f) {
        self.emit('file', f);
      });
      self.queue(null);
    });

It properly emits an error event should one occurs, however the code continues to execute resulting in another error upon output.imports.forEach(...) due to output being null. A simple output && output.import... should fix this issue.

Currently we are using this plugin with browserify and gulp. In the case of a less compilation error, the actual error is handled but the null reference error occurs outside of the event system and will result in a crash of the gulp process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant