فهرست منبع

add condition for avoid type error

ryoji-s 3 سال پیش
والد
کامیت
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' : ''}`;
     const className = `d-flex flex-column align-items-end justify-content-center ${isViewMode ? ' h-50' : ''}`;
 
 
+    if (path == null || path === undefined) {
+      return <></>;
+    }
+
     return (
     return (
       <>
       <>
         <div className={className}>
         <div className={className}>
@@ -301,8 +305,7 @@ const GrowiContextualSubNavigation = (props) => {
     path, templateMenuItemClickHandler, isPageTemplateModalShown,
     path, templateMenuItemClickHandler, isPageTemplateModalShown,
   ]);
   ]);
 
 
-
-  if (path == null || path === undefined) {
+  if (path == null) {
     return <></>;
     return <></>;
   }
   }
 
 
@@ -316,7 +319,6 @@ const GrowiContextualSubNavigation = (props) => {
     updatedAt: updatedAt ?? undefined,
     updatedAt: updatedAt ?? undefined,
   };
   };
 
 
-
   return (
   return (
     <GrowiSubNavigation
     <GrowiSubNavigation
       page={currentPage}
       page={currentPage}