Permalink
Browse files

server: catch empty part

  • Loading branch information...
1 parent 6836631 commit 0fb47a3b15113a1c149de906c64504116b5e259b @astro astro committed Feb 17, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 server.js
View
@@ -62,8 +62,11 @@ function app(app) {
}
});
part.on('end', function() {
- if (out) {
+ if (out && received > 0) {
out.commit(received);
+ } else if (out) {
+ out.discard();
+ error = new Error('File is empty');
}
});
}

0 comments on commit 0fb47a3

Please sign in to comment.