File tree 1 file changed +12
-2
lines changed
src/lineAuthor/view/gutter 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 ( ! dom ) {
59
+ return ; // sometimes, it doesn't exist anymore.
60
+ }
61
+
62
+ if ( ! document . body . contains ( dom ) ) {
63
+ dom . remove ( ) ;
64
+ }
59
65
}
60
66
}
61
67
@@ -115,10 +121,14 @@ export class LineAuthoringGutter extends GutterMarker {
115
121
}
116
122
117
123
public destroy ( dom : HTMLElement ) : void {
124
+ if ( ! dom ) {
125
+ return ; // sometimes, it doesn't exist anymore.
126
+ }
127
+
118
128
// this is called frequently, when the gutter moves outside of the view.
119
129
if ( ! document . body . contains ( dom ) ) {
120
- dom . remove ( ) ;
121
130
attachedGutterElements . delete ( dom ) ;
131
+ dom . remove ( ) ;
122
132
}
123
133
}
124
134
You can’t perform that action at this time.
0 commit comments