diff --git a/install/package.json b/install/package.json index 91c344e4d0..e4e1cfc7c7 100644 --- a/install/package.json +++ b/install/package.json @@ -103,7 +103,7 @@ "nodebb-plugin-dbsearch": "6.2.13", "nodebb-plugin-emoji": "6.0.2", "nodebb-plugin-emoji-android": "4.1.1", - "nodebb-plugin-markdown": "13.1.0", + "nodebb-plugin-markdown": "13.1.1", "nodebb-plugin-mentions": "4.7.0", "nodebb-plugin-spam-be-gone": "2.3.1", "nodebb-plugin-web-push": "0.7.3", diff --git a/src/plugins/hooks.js b/src/plugins/hooks.js index 8a5d1a885d..553e90db45 100644 --- a/src/plugins/hooks.js +++ b/src/plugins/hooks.js @@ -275,8 +275,12 @@ async function fireActionHook(hook, hookList, params) { winston.warn(`[plugins] Expected method for hook '${hook}' in plugin '${hookObj.id}' not found, skipping.`); } } else { - // eslint-disable-next-line - await hookObj.method(params); + try { + // eslint-disable-next-line + await hookObj.method(params); + } catch (err) { + winston.error(`[plugins] Error in hook ${hookObj.id}@${hookObj.hook} \n${err.stack}`); + } } } } diff --git a/src/user/delete.js b/src/user/delete.js index 9329e5150a..a4aac56c9f 100644 --- a/src/user/delete.js +++ b/src/user/delete.js @@ -234,7 +234,9 @@ module.exports = function (User) { } async function deleteImages(uid) { - const folder = path.join(nconf.get('upload_path'), 'profile', `uid-${uid}`); - await rimraf(folder); + if (utils.isNumber(uid)) { + const folder = path.join(nconf.get('upload_path'), 'profile', `uid-${uid}`); + await rimraf(folder); + } } };