From e6aa7c2d6ad93cccc4ddd91e4d9602568ab5ea50 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 15 Nov 2023 15:11:08 -0500 Subject: [PATCH] Adds protection --- src/trackers/documentTracker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/trackers/documentTracker.ts b/src/trackers/documentTracker.ts index 7d1f331..ebba250 100644 --- a/src/trackers/documentTracker.ts +++ b/src/trackers/documentTracker.ts @@ -394,7 +394,9 @@ export class DocumentTracker implements Disposable { if (this._documentMap.size === 0) return; for await (const doc of this._documentMap.values()) { - const repoPath = doc.uri.repoPath!.toLocaleLowerCase(); + const repoPath = doc.uri.repoPath?.toLocaleLowerCase(); + if (repoPath == null) continue; + if (changed?.removedRepoPaths?.has(repoPath)) { void this.remove(doc.document, doc); } else if (changed == null || changed?.addedOrChangedRepoPaths?.has(repoPath)) {