GetFiles issues

Only 2 arguments passed in to GetFiles but it was expecting 3 thus “cb”
was undefined…

File System GetFiles should handle empty “entries” array properly…
This commit is contained in:
tonysoft 2014-10-17 15:04:32 -07:00
parent 51a206adc6
commit 7d3c41a082
2 changed files with 3 additions and 2 deletions

View File

@ -199,6 +199,7 @@ FileSystemProvider.prototype.getFiles = function (container, options, cb) {
if (!validateName(container, cb)) return; if (!validateName(container, cb)) return;
var dir = path.join(this.root, container); var dir = path.join(this.root, container);
fs.readdir(dir, function (err, entries) { fs.readdir(dir, function (err, entries) {
entries = entries ? entries : [];
var files = []; var files = [];
var tasks = []; var tasks = [];
entries.forEach(function (f) { entries.forEach(function (f) {

View File

@ -154,8 +154,8 @@ StorageService.prototype.downloadStream = function (container, file, options, cb
* @param {Object|String} err Error string or object * @param {Object|String} err Error string or object
* @param {Object[]} files An array of file metadata objects * @param {Object[]} files An array of file metadata objects
*/ */
StorageService.prototype.getFiles = function (container, options, cb) { StorageService.prototype.getFiles = function (container, cb) {
return this.client.getFiles(container, options, function (err, files) { return this.client.getFiles(container, false, function (err, files) {
if (err) { if (err) {
cb(err, files); cb(err, files);
} else { } else {