Merge pull request #74 from cajoy/master

Bugfix: Cannot read property 'forEach' of undefined
This commit is contained in:
Raymond Feng 2015-06-11 12:56:35 -07:00
commit 52638e65f5
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)));