From f6c1ed80eb01b3fa99d345cb4f8d173ca22d9bef Mon Sep 17 00:00:00 2001 From: Venkat Kandagaddala Date: Thu, 25 Jul 2024 13:17:09 +0530 Subject: [PATCH] Added optional check in toc page --- .../app-toc-about/app-toc-about.component.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.ts b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.ts index 16804cbaa..b6181efc0 100644 --- a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.ts +++ b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-about/app-toc-about.component.ts @@ -189,7 +189,7 @@ export class AppTocAboutComponent implements OnInit, OnChanges, AfterViewInit, O this.loadCompetencies() } - if (this.content && this.content.contentId.includes('ext_')) { + if (this.content && this.content.contentId && this.content.contentId.includes('ext_')) { this.loadCompetencies() } @@ -210,25 +210,25 @@ export class AppTocAboutComponent implements OnInit, OnChanges, AfterViewInit, O if (changes.selectedTabValue && changes.selectedTabValue.currentValue === 0) { setTimeout(() => { if (!this.isMobile) { - if (this.summaryElem.nativeElement.offsetHeight > 72) { + if (this.summaryElem && this.summaryElem.nativeElement.offsetHeight > 72) { this.summary.ellipsis = true } - if (this.descElem.nativeElement.offsetHeight > 72) { + if (this.descElem && this.descElem.nativeElement.offsetHeight > 72) { this.description.ellipsis = true } - if (this.objectivesElem.nativeElement.offsetHeight > 72) { + if (this.objectivesElem && this.objectivesElem.nativeElement.offsetHeight > 72) { this.objectives.ellipsis = true } } else { - if (this.summaryElem.nativeElement.offsetHeight > 48) { + if (this.summaryElem && this.summaryElem.nativeElement.offsetHeight > 48) { this.summary.ellipsis = true } - if (this.descElem.nativeElement.offsetHeight > 48) { + if (this.descElem && this.descElem.nativeElement.offsetHeight > 48) { this.description.ellipsis = true } - if (this.objectivesElem.nativeElement.offsetHeight > 48) { + if (this.objectivesElem && this.objectivesElem.nativeElement.offsetHeight > 48) { this.objectives.ellipsis = true } }