Skip to content

Commit c02f7a9

Browse files
author
Kartik Raj
committed
Alternate
1 parent a863386 commit c02f7a9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/client/common/variables/systemVariables.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,14 @@ export class SystemVariables extends AbstractSystemVariables {
127127
>)[`env.${key}`] = process.env[key];
128128
});
129129
workspace = workspace ?? new WorkspaceService();
130-
if (workspace.workspaceFolders && 'forEach' in workspace.workspaceFolders) {
131-
workspace.workspaceFolders.forEach(async (folder) => {
130+
try {
131+
workspace.workspaceFolders?.forEach((folder) => {
132132
const basename = Path.basename(folder.uri.fsPath);
133133
((this as any) as Record<string, string | undefined>)[`workspaceFolder:${basename}`] =
134134
folder.uri.fsPath;
135135
});
136+
} catch {
137+
// This try...catch block is here to support pre-existing tests, ignore error.
136138
}
137139
}
138140

0 commit comments

Comments
 (0)