diff --git a/lib/decompress-zip.js b/lib/decompress-zip.js index db0f8d1..73c9df6 100644 --- a/lib/decompress-zip.js +++ b/lib/decompress-zip.js @@ -238,14 +238,16 @@ DecompressZip.prototype.extractFiles = function (files, options, results) { results = results || []; var fileIndex = 0; - files.forEach(function (file) { - var promise = self.extractFile(file, options) - .then(function (result) { - self.emit('progress', fileIndex++, files.length); - results.push(result); - }); - - promises.push(promise); + files.filter(function (file) { + return file; + }).forEach(function (file) { + var promise = self.extractFile(file, options) + .then(function (result) { + self.emit('progress', fileIndex++, files.length); + results.push(result); + }); + + promises.push(promise); }); return Q.all(promises)