diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 134186fe4..22a6799bf 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -72,9 +72,9 @@ export class AppComponent implements OnInit { if (session.account.type === AccountType.AWS || session.account.type === AccountType.AWS_TRUSTER) { if (session.account.parent === undefined) { if (session.account.idpUrl === '' || session.account.idpUrl === null || session.account.idpUrl === undefined) { - session.account.idpUrl = workspace.idpUrl[0].id; // We force the first + session.account.idpUrl = workspace.idpUrl.filter(u => (u !== null && u !== undefined))[0].id; // We force the first } else { - const found = workspace.idpUrl.filter(u => u.url === session.account.idpUrl)[0]; + const found = workspace.idpUrl.filter(u => u && u.url === session.account.idpUrl)[0]; if (found) { session.account.idpUrl = found.id; } diff --git a/src/app/services/federated-account.service.ts b/src/app/services/federated-account.service.ts index ac3d2d1e6..f88cee520 100644 --- a/src/app/services/federated-account.service.ts +++ b/src/app/services/federated-account.service.ts @@ -70,7 +70,7 @@ export class FederatedAccountService extends NativeService { console.log('idpurl in workspace', workspace.idpUrl); - if (workspace.idpUrl.findIndex(i => i.id === idpUrl.id) === -1) { + if (workspace.idpUrl.findIndex(i => i && i.id === idpUrl.id) === -1) { workspace.idpUrl.push(idpUrl); } diff --git a/src/app/services/workspace.service.ts b/src/app/services/workspace.service.ts index e0faab8ec..2731763ce 100644 --- a/src/app/services/workspace.service.ts +++ b/src/app/services/workspace.service.ts @@ -147,10 +147,10 @@ export class WorkspaceService extends NativeService { const workspace = this.configurationService.getDefaultWorkspaceSync(); let idpUrl; if (session.account.parent === undefined) { - idpUrl = workspace.idpUrl.filter(u => u.id === session.account.idpUrl)[0].url; + idpUrl = workspace.idpUrl.filter(u => u && u.id === session.account.idpUrl)[0].url; } else { const parentSession = this.sessionService.getSession(session.account.parent); - idpUrl = workspace.idpUrl.filter(u => u.id === parentSession.account.idpUrl)[0].url; + idpUrl = workspace.idpUrl.filter(u => u && u.id === parentSession.account.idpUrl)[0].url; } // TODO: probably here will need to clean the partition area to force a windows refresh diff --git a/src/app/shared/profile-page/profile-page.component.html b/src/app/shared/profile-page/profile-page.component.html index 91e19e733..e918e7f29 100644 --- a/src/app/shared/profile-page/profile-page.component.html +++ b/src/app/shared/profile-page/profile-page.component.html @@ -83,6 +83,7 @@