Procházet zdrojové kódy

throw an error if fromPage is null

Shun Miyazawa před 4 roky
rodič
revize
d6b6a4b546
1 změnil soubory, kde provedl 1 přidání a 4 odebrání
  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 {
       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);