Skip to content

Commit d98ae61

Browse files
authored
1 parent 89b035a commit d98ae61

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/vs/workbench/services/configuration/browser/configurationService.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
717717
if (e.preserveData) {
718718
await Promise.all([
719719
this.copyProfileSettings(e.previous.settingsResource, e.profile.settingsResource),
720-
this.fileService.copy(e.previous.tasksResource, e.profile.tasksResource)
720+
this.copyProfileTasks(e.previous.tasksResource, e.profile.tasksResource)
721721
]);
722722
}
723723
const promises: Promise<ConfigurationModel>[] = [];
@@ -751,6 +751,12 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
751751
await this.fileService.writeFile(to, VSBuffer.fromString(toContent));
752752
}
753753

754+
private async copyProfileTasks(from: URI, to: URI): Promise<void> {
755+
if (await this.fileService.exists(from)) {
756+
await this.fileService.copy(from, to);
757+
}
758+
}
759+
754760
private onDefaultConfigurationChanged(configurationModel: ConfigurationModel, properties?: string[]): void {
755761
if (this.workspace) {
756762
const previousData = this._configuration.toData();

src/vs/workbench/services/keybinding/browser/keybindingService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,9 @@ class UserKeybindings extends Disposable {
743743

744744
private async whenCurrentProfieChanged(e: DidChangeUserDataProfileEvent): Promise<void> {
745745
if (e.preserveData) {
746-
await this.fileService.copy(e.previous.keybindingsResource, e.profile.keybindingsResource);
746+
if (await this.fileService.exists(e.previous.keybindingsResource)) {
747+
await this.fileService.copy(e.previous.keybindingsResource, e.profile.keybindingsResource);
748+
}
747749
}
748750
this.watch();
749751
this.reloadConfigurationScheduler.schedule();

0 commit comments

Comments
 (0)