Skip to content

Commit 65a5597

Browse files
committed
Fix TypeError warning in Hover
1 parent 0d87b9b commit 65a5597

File tree

1 file changed

+5
-2
lines changed
  • packages/jupyterlab-lsp/src/features

1 file changed

+5
-2
lines changed

packages/jupyterlab-lsp/src/features/hover.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,13 @@ export class HoverCM extends CodeMirrorIntegration {
386386
protected async _updateUnderlineAndTooltip(
387387
event: MouseEvent
388388
): Promise<boolean> {
389-
const target = event.target as HTMLElement;
389+
const target = event.target;
390390

391391
// if over an empty space in a line (and not over a token) then not worth checking
392-
if (target.classList.contains('CodeMirror-line')) {
392+
if (
393+
target == null ||
394+
(target as HTMLElement).classList.contains('CodeMirror-line')
395+
) {
393396
this.remove_range_highlight();
394397
return false;
395398
}

0 commit comments

Comments
 (0)