Commit a2c307b9 authored by Benjamin Chelli's avatar Benjamin Chelli

Change 3 callbacks to explicitly return null as an error if there is no error

parent 83b2fc58
...@@ -130,7 +130,7 @@ proto.readdir = function(path, cb){ ...@@ -130,7 +130,7 @@ proto.readdir = function(path, cb){
// SMB2 close directory // SMB2 close directory
else SMB2Request('close', file, connection, function(err){ else SMB2Request('close', file, connection, function(err){
cb && cb( cb && cb(
err null
, files , files
.map(function(v){ return v.Filename }) // get the filename only .map(function(v){ return v.Filename }) // get the filename only
.filter(function(v){ return v!='.' && v!='..' }) // remove '.' and '..' values .filter(function(v){ return v!='.' && v!='..' }) // remove '.' and '..' values
...@@ -206,7 +206,7 @@ proto.readFile = function(filename, options, cb){ ...@@ -206,7 +206,7 @@ proto.readFile = function(filename, options, cb){
if(options.encoding){ if(options.encoding){
result = result.toString(options.encoding); result = result.toString(options.encoding);
} }
cb && cb(err, result); cb && cb(null, result);
}) })
} }
} }
...@@ -415,7 +415,7 @@ proto.unlink = function(path, cb){ ...@@ -415,7 +415,7 @@ proto.unlink = function(path, cb){
if(err) cb && cb(err); if(err) cb && cb(err);
// SMB2 close directory // SMB2 close directory
else SMB2Request('close', file, connection, function(err){ else SMB2Request('close', file, connection, function(err){
cb && cb(err, files); 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