Browse Source

throw an error if fromPage is null

Shun Miyazawa 3 years ago
parent
commit
d6b6a4b546
1 changed files with 1 additions and 4 deletions
  1. 1 4
      packages/app/src/server/routes/apiv3/page.js

+ 1 - 4
packages/app/src/server/routes/apiv3/page.js

@@ -474,10 +474,7 @@ module.exports = (crowi) => {
 
 
     try {
     try {
       const fromPage = await Page.findByPath(fromPath);
       const fromPage = await Page.findByPath(fromPath);
-
-      // if (fromPage == null) {
-      //   return res.apiv3({ existPaths: [] });
-      // }
+      if (fromPage == null) throw new Error('fromPage is Null');
 
 
       const fromPageDescendants = await Page.findManageableListWithDescendants(fromPage, req.user);
       const fromPageDescendants = await Page.findManageableListWithDescendants(fromPage, req.user);