soumaeda преди 2 години
родител
ревизия
f39753cff1
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      packages/editor/src/components/CodeMirrorEditor/Toolbar/DiagramButton.tsx

+ 3 - 0
packages/editor/src/components/CodeMirrorEditor/Toolbar/DiagramButton.tsx

@@ -10,6 +10,9 @@ export const DiagramButton = (props: Props): JSX.Element => {
   const { editorKey } = props;
   const { open: openDrawioModal } = useDrawioModalForEditor();
   const onClickDiagramButton = useCallback(() => {
+    if (editorKey == null) {
+      return;
+    }
     openDrawioModal(editorKey);
   }, [editorKey, openDrawioModal]);
   return (