diff --git a/src/common/providers/codeActionProvider.ts b/src/common/providers/codeActionProvider.ts index 41959973..0779edae 100644 --- a/src/common/providers/codeActionProvider.ts +++ b/src/common/providers/codeActionProvider.ts @@ -293,6 +293,12 @@ export class CodeActionProvider { // and the fix all code action for that error if there are other diagnostics with // the same error code (params.context.diagnostics).forEach((diagnostic) => { + // We have type casted diagnostic to `IDiagnostic`, however the original + // type is `Diagnostic`, the `.data` property may be missing in some cases + if (!diagnostic.data) { + return; + } + const registrations = CodeActionProvider.errorCodeToRegistrationMap.getAll( diagnostic.data.code,