mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: closes #13051, catch errors from widget render
This commit is contained in:
@@ -64,6 +64,7 @@ async function renderWidget(widget, uid, options, location) {
|
||||
|
||||
const userLang = config.userLang || meta.config.defaultLang || 'en-GB';
|
||||
const templateData = _.assign({ }, options.templateData, { config: config });
|
||||
try {
|
||||
const data = await plugins.hooks.fire(`filter:widget.render:${widget.widget}`, {
|
||||
uid: uid,
|
||||
area: options,
|
||||
@@ -93,6 +94,10 @@ async function renderWidget(widget, uid, options, location) {
|
||||
}
|
||||
|
||||
return { html };
|
||||
} catch (err) {
|
||||
winston.error(err.stack);
|
||||
return { html: '' }
|
||||
}
|
||||
}
|
||||
|
||||
widgets.checkVisibility = async function (data, uid) {
|
||||
|
||||
Reference in New Issue
Block a user