prevent a case of multiple callbacks

pull/1/head
ansuz 4 years ago
parent e89c83fa89
commit e8428a2a73

@ -378,7 +378,10 @@ var makeWalker = function (n, handleChild, done) {
nThen(function (w) { nThen(function (w) {
// check if the path is a directory... // check if the path is a directory...
Fs.stat(path, w(function (err, stats) { Fs.stat(path, w(function (err, stats) {
if (err) { return next(); } if (err) {
w.abort();
return next();
}
if (!stats.isDirectory()) { if (!stats.isDirectory()) {
w.abort(); w.abort();
return void handleChild(void 0, path, next); return void handleChild(void 0, path, next);

Loading…
Cancel
Save