mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 01:26:16 +01:00
fix: #7599 image size measurement erroring out on missing path
This commit is contained in:
@@ -291,7 +291,7 @@ function uploadImage(filename, folder, uploadedFile, req, res, next) {
|
|||||||
}),
|
}),
|
||||||
async.apply(meta.configs.set, 'brand:emailLogo', path.join(nconf.get('upload_url'), 'system/site-logo-x50.png')),
|
async.apply(meta.configs.set, 'brand:emailLogo', path.join(nconf.get('upload_url'), 'system/site-logo-x50.png')),
|
||||||
function (next) {
|
function (next) {
|
||||||
image.size(imageData.path, function (err, size) {
|
image.size(uploadedFile.path, function (err, size) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
@@ -308,7 +308,7 @@ function uploadImage(filename, folder, uploadedFile, req, res, next) {
|
|||||||
next(err, imageData);
|
next(err, imageData);
|
||||||
});
|
});
|
||||||
} else if (path.basename(filename, path.extname(filename)) === 'og:image' && folder === 'system') {
|
} else if (path.basename(filename, path.extname(filename)) === 'og:image' && folder === 'system') {
|
||||||
image.size(imageData.path, function (err, size) {
|
image.size(uploadedFile.path, function (err, size) {
|
||||||
if (err) {
|
if (err) {
|
||||||
next(err);
|
next(err);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user