Browse Source

Merge pull request #5927 from weseek/fix/can-delete-logic-exception

fix: Server error due to the canDeleteLogic method
Yuki Takei 4 years ago
parent
commit
6e082a177a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/app/src/server/service/page.ts

+ 1 - 1
packages/app/src/server/service/page.ts

@@ -262,7 +262,7 @@ class PageService {
       authority: IPageDeleteConfigValueToProcessValidation | null,
       authority: IPageDeleteConfigValueToProcessValidation | null,
       recursiveAuthority: IPageDeleteConfigValueToProcessValidation | null,
       recursiveAuthority: IPageDeleteConfigValueToProcessValidation | null,
   ): boolean {
   ): boolean {
-    const isAdmin = operator.admin;
+    const isAdmin = operator?.admin ?? false;
     const isOperator = operator?._id == null ? false : operator._id.equals(creatorId);
     const isOperator = operator?._id == null ? false : operator._id.equals(creatorId);
 
 
     if (isRecursively) {
     if (isRecursively) {