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:
parent
51a206adc6
commit
7d3c41a082
|
@ -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) {
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue