Sfoglia il codice sorgente

do not anything when path is null

kaori 4 anni fa
parent
commit
61f0623947
1 ha cambiato i file con 1 aggiunte e 5 eliminazioni
  1. 1 5
      packages/app/src/components/Navbar/SubNavButtons.tsx

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

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