Browse Source

remove null check

WNomunomu 1 year ago
parent
commit
98898e3e66
1 changed files with 1 additions and 5 deletions
  1. 1 5
      apps/app/src/components/PageSelectModal/PageSelectModal.tsx

+ 1 - 5
apps/app/src/components/PageSelectModal/PageSelectModal.tsx

@@ -67,11 +67,7 @@ export const PageSelectModal: FC = () => {
     closeModal();
     closeModal();
   }, [clickedParentPagePath, closeModal, currentPage?.path, pagePathRenameHandler]);
   }, [clickedParentPagePath, closeModal, currentPage?.path, pagePathRenameHandler]);
 
 
-  if (currentPage == null) {
-    return <></>;
-  }
-
-  const parentPagePath = pathUtils.addTrailingSlash(nodePath.dirname(currentPage.path));
+  const parentPagePath = pathUtils.addTrailingSlash(nodePath.dirname(currentPage?.path ?? ''));
 
 
   const targetPathOrId = clickedParentPagePath || parentPagePath;
   const targetPathOrId = clickedParentPagePath || parentPagePath;