Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4 from dannyamey/empty_filenames_timeout

Prevent `addFiles` timing out on empty `filenames` array
  • Loading branch information...
commit 204b18062de4771f64580bad5f785d8c0a1b42d2 2 parents 5c50e68 + ddd234d
@janjongboom janjongboom authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 janzip/janzip.js
View
4 janzip/janzip.js
@@ -105,6 +105,10 @@ var Zip = function () {
}
};
+ if (!filenames.length) {
+ return callback && callback(fileErr);
+ }
+
filenames.forEach(function (f) {
fs.readFile(f.path, function (err, data) {
if (err) {
Please sign in to comment.
Something went wrong with that request. Please try again.