Просмотр исходного кода

add null check to the conditional branch

WNomunomu 1 год назад
Родитель
Сommit
2457c2980d
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      apps/app/src/server/routes/apiv3/page/update-page.ts

+ 1 - 1
apps/app/src/server/routes/apiv3/page/update-page.ts

@@ -143,7 +143,7 @@ export const updatePageHandlersFactory: UpdatePageHandlersFactory = (crowi) => {
 
       const isGrantImmutable = isTopPage(currentPage.path) || isUsersProtectedPages(currentPage.path);
 
-      if (grant && grant !== currentPage.grant && isGrantImmutable) {
+      if (grant != null && grant !== currentPage.grant && isGrantImmutable) {
         return res.apiv3Err(new ErrorV3('The grant settings for the specified page cannot be modified.', PageUpdateErrorCode.FORBIDDEN), 403);
       }