Skip to content

Commit

Permalink
fix nullpointer for not existing zip files in dowloader
Browse files Browse the repository at this point in the history
  • Loading branch information
piwonesien committed Mar 14, 2018
1 parent 62ea89e commit da7bbb7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,18 @@ module.exports = {
});

if (extention === '.zip') {
stream = temp.createWriteStream();
rq.on('response', function(res) {
if(res.statusCode !== 200) return;
stream = temp.createWriteStream();

stream.on('finish', function() {
self.extractZip(stream.path, cachepath).then(self.stripRootFolder).then(function(files) {
resolve(files);
});
});
stream.on('finish', function() {
self.extractZip(stream.path, cachepath).then(self.stripRootFolder).then(function(files) {
resolve(files);
});
});

rq.pipe(stream);
rq.pipe(stream);
});
}

else if (extention === '.gz') {
Expand Down

0 comments on commit da7bbb7

Please sign in to comment.