File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/lineAuthor/view/gutter Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,13 @@ export class TextGutter extends GutterMarker {
55
55
}
56
56
57
57
destroy ( dom : HTMLElement ) : void {
58
- if ( ! document . body . contains ( dom ) ) dom . remove ( ) ;
58
+ if ( ! document . body . contains ( dom ) ) {
59
+ try {
60
+ dom . remove ( ) ;
61
+ } catch ( _error ) {
62
+ // sometimes, this randomly seems to fail even with the prior check, so we just ignore the error.
63
+ }
64
+ }
59
65
}
60
66
}
61
67
@@ -117,8 +123,12 @@ export class LineAuthoringGutter extends GutterMarker {
117
123
public destroy ( dom : HTMLElement ) : void {
118
124
// this is called frequently, when the gutter moves outside of the view.
119
125
if ( ! document . body . contains ( dom ) ) {
120
- dom . remove ( ) ;
121
126
attachedGutterElements . delete ( dom ) ;
127
+ try {
128
+ dom . remove ( ) ;
129
+ } catch ( _error ) {
130
+ // sometimes, this randomly seems to fail even with the prior check, so we just ignore the error.
131
+ }
122
132
}
123
133
}
124
134
You can’t perform that action at this time.
0 commit comments