@@ -105,12 +105,13 @@ export class CodeCoverageDecorations extends Disposable implements IEditorContri
105
105
} ) ) ;
106
106
107
107
this . _register ( editor . onMouseMove ( e => {
108
- if ( e . target . type === MouseTargetType . GUTTER_LINE_NUMBERS ) {
108
+ const model = editor . getModel ( ) ;
109
+ if ( e . target . type === MouseTargetType . GUTTER_LINE_NUMBERS && model ) {
109
110
this . hoverLineNumber ( editor . getModel ( ) ! , e . target . position . lineNumber ) ;
110
111
} else if ( this . lineHoverWidget . hasValue && this . lineHoverWidget . value . getDomNode ( ) . contains ( e . target . element ) ) {
111
112
// don't dismiss the hover
112
- } else if ( CodeCoverageDecorations . showInline . get ( ) && e . target . type === MouseTargetType . CONTENT_TEXT ) {
113
- this . hoverInlineDecoration ( editor . getModel ( ) ! , e . target . position ) ;
113
+ } else if ( CodeCoverageDecorations . showInline . get ( ) && e . target . type === MouseTargetType . CONTENT_TEXT && model ) {
114
+ this . hoverInlineDecoration ( model , e . target . position ) ;
114
115
} else {
115
116
this . hoveredStore . clear ( ) ;
116
117
}
@@ -168,7 +169,7 @@ export class CodeCoverageDecorations extends Disposable implements IEditorContri
168
169
}
169
170
170
171
private hoverLineNumber ( model : ITextModel , lineNumber : number ) {
171
- if ( lineNumber === this . hoveredSubject ) {
172
+ if ( lineNumber === this . hoveredSubject || ! this . details ) {
172
173
return ;
173
174
}
174
175
@@ -208,7 +209,7 @@ export class CodeCoverageDecorations extends Disposable implements IEditorContri
208
209
} ) ;
209
210
}
210
211
211
- this . lineHoverWidget . value . startShowingAt ( lineNumber , this . details ! , wasPreviouslyHovering ) ;
212
+ this . lineHoverWidget . value . startShowingAt ( lineNumber , this . details , wasPreviouslyHovering ) ;
212
213
213
214
this . hoveredStore . add ( this . editor . onMouseLeave ( ( ) => {
214
215
this . hoveredStore . clear ( ) ;
0 commit comments