Skip to content

Commit 999e430

Browse files
committed
avoid exception when delete file without thumbnail
1 parent 3af8a3c commit 999e430

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/uploadhandler.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ var EventEmitter = require('events').EventEmitter,
66
mkdirp = require('mkdirp'),
77
_ = require('lodash'),
88
async = require('async');
9-
var doNothing=function(){}
9+
var doNothing=function(){};
10+
1011
module.exports = function (options) {
1112

1213
var FileInfo = require('./fileinfo')(
@@ -189,7 +190,7 @@ module.exports = function (options) {
189190
}
190191
fs.unlink(filepath, function (ex) {
191192
_.each(options.imageVersions, function (value, version) {
192-
fs.unlink(path.join(options.uploadDir(), version, fileName),doNothing);
193+
fs.unlink(path.join(options.uploadDir(), version, fileName), doNothing);
193194
});
194195
self.emit('delete', fileName);
195196
self.callback({success: !ex});

0 commit comments

Comments
 (0)