Explorar o código

fix error when create page without template

yusuketk %!s(int64=7) %!d(string=hai) anos
pai
achega
08d0b4b7a2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/server/routes/page.js

+ 1 - 1
src/server/routes/page.js

@@ -418,7 +418,7 @@ module.exports = function(crowi, app) {
       // retrieve templates
       const template = await Page.findTemplate(path);
 
-      if (template != null) {
+      if (template.templateBody) {
         const body = replacePlaceholdersOfTemplate(template.templateBody, req);
         const tags = template.templateTags;
         renderVars.template = body;