We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e36b88a commit b97e921Copy full SHA for b97e921
lib/uploadhandler.js
@@ -37,20 +37,18 @@ module.exports = function (options) {
37
fs.readdir(options.uploadDir(), _.bind(function (err, list) {
38
async.each(list, _.bind(function(name, cb) {
39
fs.stat(options.uploadDir() + '/' + name, _.bind(function(err, stats) {
40
- if (!err) {
41
- if (stats.isFile()) {
42
- fileInfo = new FileInfo({
43
- name: name,
44
- size: stats.size
45
- });
46
- this.initUrls(fileInfo, function(err) {
47
- files.push(fileInfo);
48
- cb(err);
49
- return;
50
51
- }
+ if (!err && stats.isFile()) {
+ fileInfo = new FileInfo({
+ name: name,
+ size: stats.size
+ });
+ this.initUrls(fileInfo, function(err) {
+ files.push(fileInfo);
+ cb(err);
+ return;
52
}
53
+ else cb(err);
54
}, this));
55
}, this),
56
function(err) {
0 commit comments