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

Merge pull request #2173 from overleaf/bg-fix-track-changes-adapter-extensions

avoid exception for missing marker ids

GitOrigin-RevId: 47faa35450cafef3c55a9b63787df1d9df9f1eaa
Brian Gough 7 лет назад
Родитель
Сommit
6c2d06c78b

+ 6 - 0
services/web/public/src/ide/editor/directives/aceEditor/track-changes/TrackChangesAdapter.js

@@ -90,6 +90,9 @@ define(['ace/ace', 'ide/editor/EditorShareJsCodec'], function(
     }
 
     onInsertRemoved(change) {
+      if (this.changeIdToMarkerIdMap[change.id] == null) {
+        return
+      }
       const {
         background_marker_id,
         callout_marker_id
@@ -101,6 +104,9 @@ define(['ace/ace', 'ide/editor/EditorShareJsCodec'], function(
     }
 
     onDeleteRemoved(change) {
+      if (this.changeIdToMarkerIdMap[change.id] == null) {
+        return
+      }
       const {
         background_marker_id,
         callout_marker_id