Skip to content

Node.js based forum software built for the modern web

don't crash if there is no pluginData

Barış Soner Uşaklı5461f9fa5fdd
diff --git a/src/meta/templates.js b/src/meta/templates.js
index c80b844c64..b2d14801ae 100644
--- a/src/meta/templates.js
+++ b/src/meta/templates.js
@@ -50,9 +50,11 @@ function getTemplateDirs(activePlugins, callback) {
if (id.startsWith('nodebb-theme-')) {
return nconf.get('theme_templates_path');
}
-
+ if (!plugins.pluginsData[id]) {
+ return '';
+ }
return path.join(__dirname, '../../node_modules/', id, plugins.pluginsData[id].templates || 'templates');
- });
+ }).filter(Boolean);
var themeConfig = require(nconf.get('theme_config'));
var theme = themeConfig.baseTheme;