Commit fd21ee2d authored by Julien Fontanet's avatar Julien Fontanet

fix(unlink): close file in case of error

parent ddee7317
...@@ -32,11 +32,9 @@ module.exports = function unlink(path, cb) { ...@@ -32,11 +32,9 @@ module.exports = function unlink(path, cb) {
}, },
connection, connection,
function(err, files) { function(err, files) {
if (err) cb && cb(err);
// SMB2 close directory
else
SMB2Request('close', file, connection, function() { SMB2Request('close', file, connection, function() {
cb && cb(null, files); if (err) cb && cb(err);
else cb && cb(null, files);
}); });
} }
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment