Skip to content

Commit 4590114

Browse files
authored
Merge pull request #544 from brendan0powers/fix_highlighter_exception
Handle case where getCursor() returns null in highlighter
2 parents d86925f + 4893e3e commit 4590114

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ export class HighlightsCM extends CodeMirrorIntegration {
145145
return;
146146
}
147147

148+
if (root_position == null) {
149+
this.console.warn('no root position available');
150+
return;
151+
}
152+
148153
const token = this.virtual_editor.get_token_at(root_position);
149154

150155
// if token has not changed, no need to update highlight, unless it is an empty token

0 commit comments

Comments
 (0)