Shun Miyazawa před 4 roky
rodič
revize
7e4402e988
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 7 1
      packages/app/src/server/routes/apiv3/page.js

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

@@ -1,8 +1,9 @@
 import { pagePathUtils } from '@growi/core';
-import loggerFactory from '~/utils/logger';
+
 
 import { AllSubscriptionStatusType } from '~/interfaces/subscription';
 import Subscription from '~/server/models/subscription';
+import loggerFactory from '~/utils/logger';
 
 import { apiV3FormValidator } from '../../middlewares/apiv3-form-validator';
 
@@ -474,6 +475,11 @@ module.exports = (crowi) => {
 
     try {
       const fromPage = await Page.findByPath(fromPath);
+
+      if (fromPage == null) {
+        return res.apiv3({ existPaths: [] });
+      }
+
       const fromPageDescendants = await Page.findManageableListWithDescendants(fromPage, req.user);
 
       const toPathDescendantsArray = fromPageDescendants.map((subordinatedPage) => {