File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
src/client/common/variables Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -127,12 +127,16 @@ 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 ) => {
132- const basename = Path . basename ( folder . uri . fsPath ) ;
133- ( ( this as any ) as Record < string , string | undefined > ) [ `workspaceFolder:${ basename } ` ] =
134- folder . uri . fsPath ;
135- } ) ;
130+ if ( workspace . workspaceFolders ) {
131+ try {
132+ workspace . workspaceFolders . forEach ( ( folder ) => {
133+ const basename = Path . basename ( folder . uri . fsPath ) ;
134+ ( ( this as any ) as Record < string , string | undefined > ) [ `workspaceFolder:${ basename } ` ] =
135+ folder . uri . fsPath ;
136+ } ) ;
137+ } catch {
138+ // This try...catch block is here to support pre-existing tests, ignore error.
139+ }
136140 }
137141 }
138142
You can’t perform that action at this time.
0 commit comments