From 44b6a700eb03eb6f11a95b857a56a7c62676f99d Mon Sep 17 00:00:00 2001 From: Ben Clinkinbeard Date: Wed, 13 Jan 2016 16:59:41 -0500 Subject: [PATCH] Avoid errors with strip option --- lib/decompress-zip.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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)