Browse Source

do not anything when path is null

kaori 4 years ago
parent
commit
aa66be1643
1 changed files with 1 additions and 5 deletions
  1. 1 5
      packages/app/src/components/Navbar/SubNavButtons.tsx

+ 1 - 5
packages/app/src/components/Navbar/SubNavButtons.tsx

@@ -91,14 +91,10 @@ const SubNavButtonsSubstance = (props: SubNavButtonsSubstanceProps): JSX.Element
   }, [isGuestUser, mutateBookmarkInfo, mutatePageInfo, pageId, pageInfo]);
   }, [isGuestUser, mutateBookmarkInfo, mutatePageInfo, pageId, pageInfo]);
 
 
   const deleteMenuItemClickHandler = useCallback(async(_pageId: string): Promise<void> => {
   const deleteMenuItemClickHandler = useCallback(async(_pageId: string): Promise<void> => {
-    if (onClickDeleteMenuItem == null) {
+    if (onClickDeleteMenuItem == null || path == null) {
       return;
       return;
     }
     }
 
 
-    if (path == null) {
-      throw Error('path must not be null.');
-    }
-
     const pageToDelete: IPageForPageDeleteModal = {
     const pageToDelete: IPageForPageDeleteModal = {
       pageId,
       pageId,
       revisionId,
       revisionId,