Skip to content

Commit 084764d

Browse files
committed
Add null checks to fix integration tests
1 parent 1a46093 commit 084764d

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/vs/platform/backup/node/backupService.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,12 @@ export class BackupService implements IBackupService {
135135
}
136136

137137
return this.load().then(() => {
138-
this.fileContent.folderWorkspaces[this.workspaceResource.fsPath] = this.fileContent.folderWorkspaces[this.workspaceResource.fsPath].filter(value => value !== resource.fsPath);
139-
return this.save();
138+
const workspace = this.fileContent.folderWorkspaces[this.workspaceResource.fsPath];
139+
if (workspace) {
140+
this.fileContent.folderWorkspaces[this.workspaceResource.fsPath] = workspace.filter(value => value !== resource.fsPath);
141+
return this.save();
142+
}
143+
return TPromise.as(void 0);
140144
});
141145
}
142146

src/vs/workbench/electron-browser/shell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export class WorkbenchShell {
247247

248248
// Backup
249249
const backupService = instantiationService.createInstance(BackupService);
250-
backupService.setCurrentWorkspace(this.contextService.getWorkspace().resource);
250+
backupService.setCurrentWorkspace(this.contextService.getWorkspace() ? this.contextService.getWorkspace().resource : null);
251251
serviceCollection.set(IBackupService, backupService);
252252

253253
// Storage

0 commit comments

Comments
 (0)