From eb2a7eef68c3fe2c425ff323d4d965e80282b1eb Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Mon, 7 Mar 2022 16:31:14 -0800 Subject: [PATCH] Fix #144556 --- .../php-language-features/src/features/validationProvider.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/php-language-features/src/features/validationProvider.ts b/extensions/php-language-features/src/features/validationProvider.ts index bc8b7d25966..6a494b3231a 100644 --- a/extensions/php-language-features/src/features/validationProvider.ts +++ b/extensions/php-language-features/src/features/validationProvider.ts @@ -112,7 +112,9 @@ export default class PHPValidationProvider { vscode.workspace.onDidOpenTextDocument(this.triggerValidate, this, subscriptions); vscode.workspace.onDidCloseTextDocument((textDocument) => { this.diagnosticCollection!.delete(textDocument.uri); - delete this.delayers![textDocument.uri.toString()]; + if (this.delayers) { + delete this.delayers[textDocument.uri.toString()]; + } }, null, subscriptions); }