fix: closes #13051, catch errors from widget render

This commit is contained in:
Barış Soner Uşaklı
2025-01-15 10:02:09 -05:00
parent 5120d11721
commit 168e6b2c92

View File

@@ -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) {