소스 검색

add condition for avoid type error

ryoji-s 4 년 전
부모
커밋
4b7e75a7f3
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      packages/app/src/components/Navbar/GrowiContextualSubNavigation.tsx

+ 5 - 3
packages/app/src/components/Navbar/GrowiContextualSubNavigation.tsx

@@ -247,6 +247,10 @@ const GrowiContextualSubNavigation = (props) => {
 
     const className = `d-flex flex-column align-items-end justify-content-center ${isViewMode ? ' h-50' : ''}`;
 
+    if (path == null || path === undefined) {
+      return <></>;
+    }
+
     return (
       <>
         <div className={className}>
@@ -301,8 +305,7 @@ const GrowiContextualSubNavigation = (props) => {
     path, templateMenuItemClickHandler, isPageTemplateModalShown,
   ]);
 
-
-  if (path == null || path === undefined) {
+  if (path == null) {
     return <></>;
   }
 
@@ -316,7 +319,6 @@ const GrowiContextualSubNavigation = (props) => {
     updatedAt: updatedAt ?? undefined,
   };
 
-
   return (
     <GrowiSubNavigation
       page={currentPage}