Browse Source

Arrange null check

reiji-h 2 years ago
parent
commit
19c4914bfc
1 changed files with 9 additions and 7 deletions
  1. 9 7
      packages/presentation/src/components/GrowiSlides.tsx

+ 9 - 7
packages/presentation/src/components/GrowiSlides.tsx

@@ -21,13 +21,15 @@ export const GrowiSlides = (props: Props): JSX.Element => {
     rendererOptions, isDarkMode, disableSeparationByHeader,
   } = options;
 
-  rendererOptions?.remarkPlugins?.push([
-    extractSections.remarkPlugin,
-    {
-      isDarkMode,
-      disableSeparationByHeader,
-    },
-  ]);
+  if (rendererOptions.remarkPlugins != null) {
+    rendererOptions.remarkPlugins.push([
+      extractSections.remarkPlugin,
+      {
+        isDarkMode,
+        disableSeparationByHeader,
+      },
+    ]);
+  }
 
   if (rendererOptions.components != null) {
     rendererOptions.components.section = RichSlideSection;