diff --git a/src/app/cube/user-profile/components/profile-learning-objects/profile-learning-objects.component.html b/src/app/cube/user-profile/components/profile-learning-objects/profile-learning-objects.component.html index 61f9b75a7..f9e43d731 100644 --- a/src/app/cube/user-profile/components/profile-learning-objects/profile-learning-objects.component.html +++ b/src/app/cube/user-profile/components/profile-learning-objects/profile-learning-objects.component.html @@ -19,7 +19,7 @@

My Contributions

role="tab" (click)=" activateMainTab('released'); - content(1, collectionsReleased[0].abvName); + collectionsReleased.length && content(1, collectionsReleased[0].abvName); activateCollectionTab(0) " [ngClass]="{ active: tabMain === 1 }"> @@ -30,7 +30,7 @@

My Contributions

role="tab" (click)=" activateMainTab('review'); - content(2, collectionsUnreleased[0].abvName); + collectionsUnreleased.length && content(2, collectionsUnreleased[0].abvName); activateCollectionTab(0) " [ngClass]="{ active: tabMain === 2 }"> diff --git a/src/app/cube/user-profile/components/profile-learning-objects/profile-learning-objects.component.ts b/src/app/cube/user-profile/components/profile-learning-objects/profile-learning-objects.component.ts index 521446129..17f247dc9 100644 --- a/src/app/cube/user-profile/components/profile-learning-objects/profile-learning-objects.component.ts +++ b/src/app/cube/user-profile/components/profile-learning-objects/profile-learning-objects.component.ts @@ -99,7 +99,9 @@ export class ProfileLearningObjectsComponent implements OnChanges { a.name.localeCompare(b.name), ); // Default first released collection tab values - this.content(this.tabMain, this.collectionsReleased[0].abvName); + if (this.collectionsReleased.length > 0) { + this.content(this.tabMain, this.collectionsReleased[0].abvName); + } this.loading = false; }); }