diff --git a/src/vs/workbench/contrib/userData/common/userData.contribution.ts b/src/vs/workbench/contrib/userData/common/userData.contribution.ts index 399ab2dc7c994..d7b27434f22d2 100644 --- a/src/vs/workbench/contrib/userData/common/userData.contribution.ts +++ b/src/vs/workbench/contrib/userData/common/userData.contribution.ts @@ -53,8 +53,10 @@ class AutoSyncUserDataContribution extends Disposable implements IWorkbenchContr private async autoSync(): Promise { if (this.configurationService.getValue('userData.autoSync')) { const userIdentity = this.userIdentityService.getUserIndetities()[0]; - await this.extensionService.activateByEvent(`onUserData:${userIdentity.identity}`); - this.userDataSyncService.synchronise(); + if (userIdentity) { + await this.extensionService.activateByEvent(`onUserData:${userIdentity.identity}`); + this.userDataSyncService.synchronise(); + } } }