Skip to content

Commit 0fe7e05

Browse files
committed
Fix an undefined access.
1 parent 3614cab commit 0fe7e05

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Extension/src/LanguageServer/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,8 @@ export class DefaultClient implements Client {
18421842
public onDidChangeTextDocument(textDocumentChangeEvent: vscode.TextDocumentChangeEvent): void {
18431843
if (util.isCpp(textDocumentChangeEvent.document)) {
18441844
// If any file has changed, we need to abort the current rename operation
1845-
if (workspaceReferences.renamePending) {
1845+
if (workspaceReferences !== undefined // Occurs when a document changes before cpptools starts.
1846+
&& workspaceReferences.renamePending) {
18461847
workspaceReferences.cancelCurrentReferenceRequest(refs.CancellationSender.User);
18471848
}
18481849

0 commit comments

Comments
 (0)