Skip to content

Commit

Permalink
Prevent accessing rootUri if there's no git repository
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Oct 15, 2024
1 parent 2277709 commit 43a7616
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vscode/src/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export class Workspace implements WorkspaceInterface {
if (gitExtension) {
const api = gitExtension.exports.getAPI(1);
const repository = await api.openRepository(this.workspaceFolder.uri);
rootGitUri = repository.rootUri;

if (repository) {
rootGitUri = repository.rootUri;
}
}

this.registerCreateDeleteWatcher(
Expand Down

0 comments on commit 43a7616

Please sign in to comment.