Explorar o código

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

fix: Server error due to the canDeleteLogic method
Yuki Takei %!s(int64=3) %!d(string=hai) anos
pai
achega
6e082a177a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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) {