Skip to content

Commit

Permalink
files.partcipants.timeout doesn't handle the undefined case (fix #128335
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bpasero committed Jul 10, 2021
1 parent 20790ec commit 4f90d80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class WorkingCopyFileOperationParticipant extends Disposable {

async participate(files: SourceTargetPair[], operation: FileOperation, undoInfo: IFileOperationUndoRedoInfo | undefined, token: CancellationToken): Promise<void> {
const timeout = this.configurationService.getValue<number>('files.participants.timeout');
if (timeout <= 0) {
if (typeof timeout !== 'number' || timeout <= 0) {
return; // disabled
}

Expand Down
8 changes: 7 additions & 1 deletion src/vs/workbench/test/browser/workbenchTestServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,13 @@ export function workbenchInstantiationService(
instantiationService.stub(IProgressService, new TestProgressService());
const workspaceContextService = new TestContextService(TestWorkspace);
instantiationService.stub(IWorkspaceContextService, workspaceContextService);
const configService = new TestConfigurationService();
const configService = new TestConfigurationService({
files: {
participants: {
timeout: 60000
}
}
});
instantiationService.stub(IConfigurationService, configService);
instantiationService.stub(IFilesConfigurationService, disposables.add(new TestFilesConfigurationService(contextKeyService, configService)));
instantiationService.stub(ITextResourceConfigurationService, new TestTextResourceConfigurationService(configService));
Expand Down

0 comments on commit 4f90d80

Please sign in to comment.