소스 검색

add optional

soumaeda 2 년 전
부모
커밋
9adfcd52bb
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      apps/app/src/components/PageEditor/PageEditor.tsx

+ 1 - 1
apps/app/src/components/PageEditor/PageEditor.tsx

@@ -187,7 +187,7 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
   const { data: codeMirrorEditor } = useCodeMirrorEditorIsolated(GlobalCodeMirrorEditorKey.MAIN);
 
   const openTableModalHandler = useCallback(() => {
-    const editor = codeMirrorEditor.view;
+    const editor = codeMirrorEditor?.view;
     const markdownTable = mtu.getMarkdownTable(editor);
     openHandsontableModal(markdownTable, editor);
   }, []);