Skip to content

Commit

Permalink
Handle sass.NULL returned from the importer via done()
Browse files Browse the repository at this point in the history
Whenever done() is called we should check for the sass.NULL
value as well.

Fixes #1296
  • Loading branch information
saper committed Dec 20, 2015
1 parent 00ea12c commit 78b313f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,27 +301,27 @@ module.exports.render = function(options, cb) {
if (Array.isArray(importer)) {
importer.forEach(function(subject, index) {
options.importer[index] = function(file, prev, bridge) {
function done(data) {
bridge.success(data);
function done(result) {
bridge.success(result === module.exports.NULL ? null : result);
}

var result = subject.call(options.context, file, prev, done);

if (result) {
done(result === module.exports.NULL ? null : result);
done(result);
}
};
});
} else {
options.importer = function(file, prev, bridge) {
function done(data) {
bridge.success(data);
function done(result) {
bridge.success(result === module.exports.NULL ? null : result);
}

var result = importer.call(options.context, file, prev, done);

if (result) {
done(result === module.exports.NULL ? null : result);
done(result);
}
};
}
Expand Down

0 comments on commit 78b313f

Please sign in to comment.