Просмотр исходного кода

Merge pull request #1111 from sharelatex/as-fix-spell-check

Fix bug where read only editor would crash

GitOrigin-RevId: ed8ac8ddcec118b57e20916afaddb50d5062b2cf
Alasdair Smith 7 лет назад
Родитель
Сommit
221acb8207
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      services/web/public/src/ide/editor/directives/aceEditor.js

+ 2 - 0
services/web/public/src/ide/editor/directives/aceEditor.js

@@ -594,6 +594,7 @@ define([
         }
 
         const initSpellCheck = function() {
+          if (!spellCheckManager) return
           spellCheckManager.init()
           editor.on('changeSession', onSessionChangeForSpellCheck)
           onSessionChangeForSpellCheck({ session: editor.getSession() }) // Force initial setup
@@ -601,6 +602,7 @@ define([
         }
 
         const tearDownSpellCheck = function() {
+          if (!spellCheckManager) return
           editor.off('changeSession', onSessionChangeForSpellCheck)
           return editor.off(
             'nativecontextmenu',