mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #8112, don't crash hook returns no data
This commit is contained in:
@@ -22,6 +22,10 @@ exports.get = async function (req, res, callback) {
|
|||||||
templateData: {},
|
templateData: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!data || !data.templateData) {
|
||||||
|
return callback(new Error('[[error:invalid-data]]'));
|
||||||
|
}
|
||||||
|
|
||||||
if (data.templateData.disabled) {
|
if (data.templateData.disabled) {
|
||||||
res.render('', {
|
res.render('', {
|
||||||
title: '[[modules:composer.compose]]',
|
title: '[[modules:composer.compose]]',
|
||||||
|
|||||||
Reference in New Issue
Block a user