Bugfix: Cannot read property 'forEach' of undefined

This commit is contained in:
Oleksii Strutsynskyi 2015-06-11 11:28:34 -04:00
parent db1b449aff
commit 3158e3e479
1 changed files with 2 additions and 0 deletions

View File

@ -123,6 +123,8 @@ FileSystemProvider.prototype.destroyContainer = function (containerName, cb) {
var dir = path.join(this.root, containerName);
fs.readdir(dir, function (err, files) {
files = files || [];
var tasks = [];
files.forEach(function (f) {
tasks.push(fs.unlink.bind(fs, path.join(dir, f)));