mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-09-02 11:28:00 +02:00
closes #4164
This commit is contained in:
@@ -168,6 +168,9 @@ module.exports = function(User) {
|
||||
}, next);
|
||||
},
|
||||
function(next) {
|
||||
file.isFileTypeAllowed(tempPath, next);
|
||||
},
|
||||
function(tempPath, next) {
|
||||
var image = {
|
||||
name: 'profileCover',
|
||||
path: data.file ? data.file.path : tempPath,
|
||||
@@ -204,7 +207,9 @@ module.exports = function(User) {
|
||||
}
|
||||
], function(err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
return fs.unlink(tempPath, function(unlinkErr) {
|
||||
callback(err); // send back the original error
|
||||
});
|
||||
}
|
||||
|
||||
if (data.position) {
|
||||
|
||||
Reference in New Issue
Block a user