mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
fix: #7490, handling of image sizes if no size saved in db
This commit is contained in:
@@ -58,7 +58,7 @@ module.exports = function (Posts) {
|
||||
|
||||
Posts.uploads.listWithSizes = async function (pid) {
|
||||
const paths = await Posts.async.uploads.list(pid);
|
||||
const sizes = await db.async.getObjects(paths.map(path => 'upload:' + md5(path)));
|
||||
const sizes = await db.async.getObjects(paths.map(path => 'upload:' + md5(path))) || {};
|
||||
|
||||
return sizes.map((sizeObj, idx) => {
|
||||
sizeObj.name = paths[idx];
|
||||
|
||||
Reference in New Issue
Block a user