Skip to content

Commit d642e72

Browse files
committed
Minor fix in node clean method
The `$.clean` `onError` callback is only invoked if an exception has actually been passed to the `fs.unlink()` callback.
1 parent 99d5e61 commit d642e72

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

samples/Node.js/flow-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ module.exports = flow = function(temporaryFolder) {
191191

192192
console.log('exist removing ', chunkFilename);
193193
fs.unlink(chunkFilename, function(err) {
194-
if (options.onError) options.onError(err);
194+
if (err && options.onError) options.onError(err);
195195
});
196196

197197
pipeChunkRm(number + 1);

0 commit comments

Comments
 (0)