From 805ba83b5983ab78e0e4a29cd14994d6839a2edd Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 5 Nov 2020 07:17:41 +0100 Subject: [PATCH] Storage service error in shared process console (fix #109985) --- src/vs/platform/storage/node/storageService.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/vs/platform/storage/node/storageService.ts b/src/vs/platform/storage/node/storageService.ts index 11049a8f969..97cb9b161ac 100644 --- a/src/vs/platform/storage/node/storageService.ts +++ b/src/vs/platform/storage/node/storageService.ts @@ -201,10 +201,16 @@ export class NativeStorageService extends AbstractStorageService { } protected async doFlush(): Promise { - await Promise.all([ - this.getStorage(StorageScope.GLOBAL).whenFlushed(), - this.getStorage(StorageScope.WORKSPACE).whenFlushed() - ]); + const promises: Promise[] = []; + if (this.globalStorage) { + promises.push(this.globalStorage.whenFlushed()); + } + + if (this.workspaceStorage) { + promises.push(this.workspaceStorage.whenFlushed()); + } + + await Promise.all(promises); } private doFlushWhenIdle(): void { -- GitLab