diff --git a/src/app/item-page/cris-item-page-tab.resolver.ts b/src/app/item-page/cris-item-page-tab.resolver.ts index aaca1568572..b381a993664 100644 --- a/src/app/item-page/cris-item-page-tab.resolver.ts +++ b/src/app/item-page/cris-item-page-tab.resolver.ts @@ -54,7 +54,11 @@ export class CrisItemPageTabResolver implements Resolve !givenTab || `/${tab.shortname}` === givenTab); - const mainTab = tabsRD.payload.page.filter((tab) => !tab.leading)[0]; + + const mainTab = tabsRD.payload.page.length === 1 + ? tabsRD.payload.page[0] + : tabsRD.payload.page.find(tab => !tab.leading); + if (!isValidTab) { // If wrong tab is given redirect to 404 page this.router.navigateByUrl(getPageNotFoundRoute(), { skipLocationChange: true, replaceUrl: false });