Sfoglia il codice sorgente

BugFix: MarkdownTableInterceptor

Yuki Takei 7 anni fa
parent
commit
acfb1d090e

+ 3 - 5
resource/js/components/PageEditor/MarkdownTableInterceptor.js

@@ -34,11 +34,9 @@ export default class MarkdownTableInterceptor extends BasicInterceptor {
     const context = Object.assign(args[0]);   // clone
     const context = Object.assign(args[0]);   // clone
     const editor = context.editor;            // AbstractEditor instance
     const editor = context.editor;            // AbstractEditor instance
 
 
-    if (editor != null) {
-      if (editor.constructor.name !== 'CodeMirrorEditor') {
-        // resolve
-        return Promise.resolve(context);
-      }
+    // do nothing if editor is not a CodeMirrorEditor
+    if (editor == null || editor.getCodeMirror() == null) {
+      return Promise.resolve(context);
     }
     }
 
 
     const cm = editor.getCodeMirror();
     const cm = editor.getCodeMirror();