mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 06:09:02 +02:00
Ensure variables are defined when handling message from lint worker (#27561)
GitOrigin-RevId: 69e18c41707be360eb30657780915efb0d1c9aa7
This commit is contained in:
+3
-3
@@ -35,10 +35,10 @@ const runLinter = () => {
|
||||
})
|
||||
}
|
||||
|
||||
lintWorker!.addEventListener('message', event => {
|
||||
if (event.data) {
|
||||
lintWorker.addEventListener('message', event => {
|
||||
if (event.data && event.data.errors && currentView) {
|
||||
const errors = event.data.errors as LintError[]
|
||||
const editorState = currentView!.state
|
||||
const editorState = currentView.state
|
||||
const doc = editorState.doc
|
||||
const cursorPosition = editorState.selection.main.head
|
||||
const diagnostics = errorsToDiagnostics(errors, cursorPosition, doc.length)
|
||||
|
||||
Reference in New Issue
Block a user