soumaeda пре 2 година
родитељ
комит
f39753cff1

+ 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 (